2

I am trying to figure out a solution to getting a WebRole to run a Task every morning at 5AM. I have looked at Quartz.Net and the examples on stackoverflow but all of them schedule the task to run every 10 minutes. Are there any examples that show how I can schedule it?

Mike Diaz
  • 2,045
  • 4
  • 32
  • 55

2 Answers2

3

You might also want to check out the Scheduler add-on in the Windows Azure Store (login to the portal at manage.windowsazure.com, head to Add-Ons, then hit App Services and select Scheduler).

Up to 5,000 scheduled jobs/month are free.

Mlunes
  • 481
  • 2
  • 5
2

Quartz.Net should be good for you.Try to use CronTrigger (or CronTriggerImpl in version 2.x).

Example of cron-expression - "0 0 5 * * ?" - run every day at 5 AM.

Cron trigger sub-expression position meaning:

  1. Seconds - 0 for you (run at 0 second)
  2. Minutes - 0 for you (run at 0 minutes)
  3. Hours - 5 for you (run at 5 hour; it uses 24-hour clock)
  4. Day-of-Month - * - run every day
  5. Month - * for you (run every month)
  6. Day-of-Week - ? - not specified for you (Day-of-Month has been used instead)
  7. Year (optional field) - not used
Tom
  • 26,212
  • 21
  • 100
  • 111