0

I'm trying to come up with a schedule for my Azure WebJob in crontab format that will run every 15 minutes but exactly at h:00, h:15, h:30 and h:45.

The one that I'm using for my web job right now is:

{ "schedule": "0 0/15 * * * *" }

But this doesn't make it run exactly at the top of the hour then every 15 minutes thereafter.

I want the job to keep running -- no end date/time. However, when I launch the webjob, it should not start running until it's h:00, h:15, h:30 or h:45 -- whichever happens to be next. For example, if I deploy my webJob at 8:37 AM, the first run should be at 8:45 AM AND it should then keep running every 15 minutes after that.

I'd appreciate some help with this. Thanks.

Thomas
  • 24,234
  • 6
  • 81
  • 125
Sam
  • 26,817
  • 58
  • 206
  • 383
  • That schedule looks correct - what interval is your job running on? What's the problem? – mathewc Dec 13 '15 at 09:57
  • My solution makes the job run every 15 minutes but the job doesn't run exactly at those times I mentioned in my question. For example, if I deploy my webJob to Azure at 9:03 AM, it will run at 9:03 AM. Then the next one will be at 9:18 AM. What I want is: if I deploy the job at 9:03 AM, the first run should be at 9:15 AM, then 9:30, then 9:45, then 10 AM, and so on. – Sam Dec 13 '15 at 18:36
  • That shouldn't be the case. If it is, please log a bug on the public issues list here: https://github.com/projectkudu/kudu/issues. The computation we do internally to compute the next timer interval should result in the schedule you expect. How are you determining the schedule is off - via the execution entries in the portal, or your own logging code? – mathewc Dec 14 '15 at 02:40
  • I investigated more and have been able to repro this. I've created an issue in our repo here: https://github.com/projectkudu/kudu/issues/1834. We'll get this fixed soon, and when the update deploys to Azure your job will run as expected. – mathewc Dec 14 '15 at 19:54
  • On further investigation, I actually can't repro this. Can you please give me some exact steps I can follow to see the behavior you're seeing? I've tried various combinations of schedule changes/updates but it's working correctly for me. Please add any further notes on this to the issue here: https://github.com/projectkudu/kudu/issues/1834. Once we resolve, I'll post back to this thread. – mathewc Dec 15 '15 at 01:46

2 Answers2

1

Use */15 for minutes:

0 */15 * * * *
  • Azure WebJobs uses the expanded 6 field CRON format which includes seconds. So his original expression is correct. – mathewc Dec 13 '15 at 16:18
1

From this answer

field          allowed values
-----          --------------
second         0-59
minute         0-59
hour           0-23
day of month   1-31
month          1-12 (or names, see below)
day of week    0-7 (0 or 7 is Sun, or use names)

So for you :

{ "schedule": "0 0,15,30,45 * * * *" }
Community
  • 1
  • 1
Thomas
  • 24,234
  • 6
  • 81
  • 125