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'm editing a crontab for a job that I want to run every minute but only between the hours of 10pm and 2am. Outside this time I'd like it to run every 10 minutes, I'm not sure if this is possible though.

Any help appreciated, thanks.

share|improve this question
figured this out: */1 22-2 * * * and */10 2-22 * * * – Darryl Jul 15 '10 at 11:58

It would probably be best to have it a 2 separate jobs, one for each hourly group

* 22-23,0-2 * * * command
*/10 2-22 * * * command
share|improve this answer
Excellent post! – kixorz Jul 22 '15 at 4:14

It's easiest to do in two lines.

* 22-23,0-2 * * * command
*/10 2-22 * * * command

This might be specific syntax for vixie cron, though. Check man 5 crontab

share|improve this answer

Yes, that is possible. Taken from crontab(5):

Ranges of numbers are allowed. Ranges are two numbers separated with a hyphen. The specified range is inclusive. For example, 8-11 for an ``hours'' entry specifies execution at hours 8, 9, 10 and 11.

Lists are allowed. A list is a set of numbers (or ranges) separated by commas. Examples: 1,2,5,9'', 0-4,8-12''.

(Assuming Vixie Cron)

share|improve this answer

Your Answer


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