Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

What is the crontab syntax for specifying running hours/minutes based on the day of the week in a single entry?

There's a task which needs to be executed every /1 minute from Monday,01:00 to Saturday,01:00, so after specifying the days (1-6) I still have to exclude 00:00-00:59 from Monday and 01:00-23:59 from Sunday.

I don't want to keep it done with three entries instead of one; doing additional time check via some wrapper script is also not a good option.

Cron flavor: vixie-cron, could be changed to another if required.

share|improve this question

You can't do this cron isn't that smart as you mention you will need 3 lines

* 1-23 * * 1 task
#Tue to Sat
* * * * 2-6 task
# Sun 
* 1 * * 0 task

or something similar.

share|improve this answer
Should be 2-6 for Tuesday to Saturday. 2,6 is Tuesday and Saturday – faker Jun 18 '14 at 13:48

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.