To run a task every 20 minutes starting at 5 past the hour, try this:

`5-59/20 * * * *`

ExplanationAn

`*`

in the minute field is the same as`0-59/1`

where`0-59`

is therangeand`1`

is thestep. The command will run at the first minute in therange(0), then at all successive minutes that are distant from the first bystep(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.

Examples

`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 offset

**Posted:**April 18, 2014

**Filed under:**Linux, Solutions, Tips, Ubuntu 3 Comments

How to run a cron job with an offset?

Quote:

Ref.: Source

Advertisements

This is a subject matter tht is close to my

heart… Many thanks! Where do your contact details though?

Pretty! This is an extremely wonderful post.

Many thanks for providing these records.

I aam really loving the theme/design of your web site. Do you ever ruun into any browser compatibility

issues? A small nnumber off my blog readers have

complained about my site not operating correctly in Expplorer

but looks great in Safari. Do yyou have any advice too help fix this issue?