`*/20 * * * *`

Ensures it runs every 20 minutes, I'd like to run a task every 20 minutes, starting at 5 past the hour, is this possible with Cron? Would it be:

`5/20 * * * *`

?

Skip to content
# Run Cron job every N minutes plus offset

###### Related Question

cron

`*/20 * * * *`

Ensures it runs every 20 minutes, I'd like to run a task every 20 minutes, starting at 5 past the hour, is this possible with Cron? Would it be:

`5/20 * * * *`

?

- Linux – How to get a cron job to run every 30 minutes
- Ubuntu – Running a cron every 30 seconds
- Cron : Setting multiple minutes
- Php – CRON command to run URL address every 5 minutes
- Unix – How to run a cron job every 5 minutes starting from a time other than 0 minutes
- Unix – Configure cron job to run every 15 minutes on Jenkins
- Docker – How to run a cron job inside a docker container

## Best Solution

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

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.