views:

464

answers:

1

Is there a way to adjust the schedule of a Sharepoint timer job? The only options I'm seeing in central admin is the option to enable/disable the job and a way to change the job name. Are there some kind of permissions that I need to actually start a job or edit any meaningful data?

I inherited a couple of projects when someone left the company, so please pardon my absolute ignorance of all things Sharepoint.

Thanks Joe

+1  A: 

You cannot adjust timer jobs via the UI. And you cannot start a timer job by yourself, they get started by the Windows SharePoint Services Timer service who is responsible for them. To set the schedule for a timer job you have to access and edit the SPJobDefinition object (name of the timer job class in the SharePoint object model) via code.

A SPJobDefinition object has a Schedule property to which you can pass a SPSchedule object to set the start time and the repetition of the job. There are different schedule classes you can select from:

  • SPOneTimeSchedule
  • SPMinuteSchedule
  • SPHourlySchedule
  • SPDailySchedule
  • SPMonthlySchedule
  • SPWeeklySchedule
  • SPYearlySchedule

But I wouldn't change the schedule of the timer jobs that come with SharePoint unless you know what you are doing.

Flo
Thanks for the info. The job I am working with is a custom (in house) job that extracts some data. What I'd really like to be able to do is kick the job off (command line?) to be able to troubleshoot it. Sharepoint is saying that it ran successfully, but I am not seeing the output that I should be.Thanks again.
Joe
You cannot start a timer job manually, its always started by the timer service. So in you case I would refactor the timer job and move the code the timer job executes to an extra method or even class. By doing this you are able to test and debug you code without the need of the timer job itself.
Flo