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 have 2 cron jobs, i want one of them to run every odd minute (1,3,5,7,9,11....57,59) and i want the other one to run every even minute (0,2,4,6,8,10,12...58)

how can i do it in an easy way? (no scripting - just cron job rules)

share|improve this question
*/2 * * * * date >>/tmp/even
1-59/2 * * * * date >>/tmp/odd
share|improve this answer
perfecto! thank you jj33 – wabbajay Jan 7 '11 at 21:37
whoops! i bet you supplied the correct syntax for the "1-59/2" part... can i ask why when i enter this in cpanel it doesnt work? It says "Cron field not formatted correctly..." – wabbajay Jan 7 '11 at 21:43
I don't use cpanel, but I'm going to go out on a limb and suggest that the filter they have placed between you and the actual crontab doesn't see it as valid. It really is though, I typed that exactly into my crontab on a CentOS5 server and got the even minutes in in /tmp/even and odd minutes in /tmp/odd. Sorry cpanel's filtering it... – jj33 Jan 7 '11 at 21:46
thats what i suspected too... i ll set it manually... thank you for your help jj33 :) – wabbajay Jan 7 '11 at 21:53
FYI, for the 1-59/2 syntax. if you want an explaination see – General Redneck Jun 12 '15 at 21:19
*/2 * * * * /path/to/foo
*/2 * * * * sleep 60; /path/to/bar

Is that that sleep 60 too much like a script?

share|improve this answer
yes its more like a script and for sure it is not "just cron job rules". thank you for your time anyway ;) – wabbajay Jan 7 '11 at 21:39

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.