I want to set a cronjob to execute after every 10 minutes from morning 1000 hours to evening 1730 hours. Is it possible to set this in the crontab file ?

Thanks.

link|improve this question
1  
Questions like this make me wish there was an option to close question because the OP has put in absolutely no effort to help themselves. – John Gardeniers Mar 16 '11 at 6:52
feedback

1 Answer

You would need multiple entries for the job:

0,10.20,30,40,50 10-16 * * * myjob
0,10,20          17    * * * myjob

(Add ",30" to the second line if you want the end time to be inclusive.)

link|improve this answer
I have done that already. Is it possible to achieve this having a single cronjob entry ? – Iliyas Shirol Mar 16 '11 at 5:17
No; there have been several attempts to replace cron with something more flexible, but none ever caught on (the existing cron replacements all use the same time specification syntax). – geekosaur Mar 16 '11 at 5:19
2  
If the OP really really wants one cronjob entry, he could add a check in his job to see if the time was in the correct range, and skip execution if not. – Phil Hollenback Mar 16 '11 at 5:22
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.