Search code examples
croncrontrigger

Setting Cron Job


I have requirement which say I need to set cron to run a job daily from monday to thursday twice i.e at 10 PM and 5 PM.And the same job should also run on friday 5 PM and on sunday at 10 PM

For the first part of the requirement I have set as " 0 22 * * 1-4" But how do I set for the second requirment also ?

I need to set as a single cron line. Please help/suggest.


Solution

  • Multiple values for a field can be provided as comma separated values. For ex. "0 0 10,17 ? * MON-THU" Here is one good link to refer: http://www.quartz-scheduler.net/documentation/quartz-2.x/tutorial/crontriggers.html