How do I make cron run something every "N"th minute, where n % 5 == 1?

mike picture mike · Jan 22, 2009 · Viewed 27.9k times · Source

I know that I can have something run every five minutes in cron with a line like:

 */5 * * * * /my/script

What if I don't want it running at 12:00, 12:05, 12:10, but rather at 12:01, 12:06, 12:11, etc? I guess I can do this:

 1,6,11,16,21,26,31,36,41,46,51,56 * * * * /my/script

...but that's ugly. Is there a more elegant way to do it?

Answer

David Z picture David Z · Jan 22, 2009
1-56/5 * * * * /my/script

This should work on vixiecron, I'm not sure about other implementations.