1

I want to run a cron job for every 2 minutes from 9:30 to 12.How should I do it?

Is this correct? Where should I add 30?

*/2  9-12   *   *   *
fedorqui
  • 275,237
  • 103
  • 548
  • 598
Shan
  • 2,822
  • 9
  • 40
  • 61
  • Take a look at this: http://stackoverflow.com/questions/12786410/run-cron-job-every-n-minutes-plus-offset – ryekayo May 05 '15 at 14:26
  • it is a bit unclear which times you want the job to run: 9.30, 10, 10.30, 11, 11.30 and 12? – fedorqui May 05 '15 at 15:50

1 Answers1

2

You'll actually need two cronjobs. Add 30-59 in the place of the first asterisk, for execution from 9:30 until 10: 30-59/2 9 * * *. And then a second one for execution from 10:00 until 12:00 */2 10-12 * * *

Easy tool to check: http://cronchecker.net/check?statement=30-59%2F2+9-12+++*+echo+yep So the whole thing will be something like:

30-59/2 9 * * * echo yep
*/2 10-12 * * * echo yep
wkoot
  • 139
  • 1
  • 10