Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have written a custom timer job that should only run on one server in the farm. The constructor is as follows:

public class MyCustomTimerJob : SPJobDefinition {

public MyCustomTimerJob () : base() { }

public MyCustomTimerJob (SPWebApplication webApp)
: base("CustomJobName", webApp, null, SPJobLockType.Job)
{
    this.Title = "CustomJobName";
}

I schedule the job with the following code:

SPDailySchedule schedule = SPDailySchedule.FromString("daily at 6:00");

MyCustomTimerJob job = new MyCustomTimerJob(webApp);
job.Schedule = schedule;
job.Update(true);

When I look at the Scheduled Jobs in Central Admin, it shows the job scheduled to run on all 3 WFE servers. I expected it to only be scheduled on a single server since the lock type is SPJobLockType.Job.

When the scheduled time comes, the job does not run and I don't see anything in the ULS logs.

Of course this is a new production deployment and the issue cannot be reproduced in the test or dev farms.

Any suggestions?

share|improve this question

1 Answer 1

As you can see here: http://manomangaldas.blogspot.be/2008/06/sharepoint-job-spjoblocktype-which-one.html

even if you see the job scheduled on all WFE, actually it will run on single server (one instance) when Lock Type is Job.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.