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?