To run a task every 20 minutes starting at 5 past the hour, try this:
5-59/20 * * * *
*in the minute field is the same as
0-59is the range and
1is the step. The command will run at the first minute in the range (0), then at all successive minutes that are distant from the first by step (1), until the last (59).
Which is why
*/20 * * * *will run at 0 minutes, 20 minutes after, and 40 minutes after — which is the same as every 20 minutes. However,
*/25 * * * *will run at 0 minutes, 25 minutes after, and 50 minutes after — which is not the same as every 25 minutes. That’s why it’s usually desirable to use a step value in the minute field that divides evenly into 60.
So to offset the start time, specify the range explicitly and set the first value to the amount of the offset.
5-59/20 * * * *will run at 5 minutes after, 25 minutes after, and 45 minutes after.
10-59/25 * * * *will run at 10 minutes after and 35 minutes after.
1-59/2 * * * *will run every odd minute.
Crontab offsetPosted: April 18, 2014
How to run a cron job with an offset?