How to run a cronjob every odd or even minute

I’ve tested this for Vixie Cron and Cronie.

There is an “extensions” section on the crontab(5) man page which says – Ranges can include “steps”, so “1-9/2” is the same as “1,3,5,7,9”.

*/2 * * * * date >>/tmp/even
1-59/2 * * * * date >>/tmp/odd

If you require more portability across different versions, you may want to stick to the much simpler list:


But it might be easier to write a shell script which is called every minute and wrap your command in it, which will immediately exit if it is not called in an odd minute.

Share your views