tags:

views:

27

answers:

2

I have two cronjobs, each using a "*/5 * * * *" schedule.

What I really want is to execute them every ten minutes, but the second one 5 minutes later than the first one.

Is there an elegant way to do this?

A: 

Have your first cron task call at, which allows you to schedule a one-off execution at a specific time.

ceejayoz
Interesting solution, never thought of that. But I'd rather like to express this using the cron syntax, leaving the scheduled scripts untouched. Of course I could do 0,10,20,30,40,50 * * * * and 5,15,25,35,45,55 * * * *, but thats messy.
Unfortunately, I don't think there's any way to offset `*/##` syntax in a cron listing.
ceejayoz
A: 

How about:

*/10 * * * * firstcommand
5-55/10 * * * * secondcommand

This works with at least one cron daemon---Dillon's cron, which I'm the current dev of. Whether it works on Vixie cron, or fcron, or bcron, or whichever cron daemon you happen to be using, I can't say.

profjim