Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to run a cron job every 10 minutes, only between 4:40 and 0:15. I've managed to schedule the cron job to run from 4 to 0 o'clock, but can't figure out how to schedule it further. This is what I came out with: */10 4-23,0 * * * script

share|improve this question
up vote 7 down vote accepted

Sometimes you just have to break out the ugly, and duplicate entries to get selection logic like that. It should work and be pretty apparent with what it's doing without uber cron-fu knowledge.

40,50 4 * * * script
*/10 5-23 * * * script
0,10 0 * * * script

Oh, and a helpful site for generating these:

share|improve this answer
I was wondering about splitting the cron into 3, but thought there is a more elegant way of doing it. Anyway, will go for it, thank you! – Andrei Horak Feb 6 '12 at 23:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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