Variations
| Schedule | Expression |
|---|---|
| Every 5 minutes | */5 * * * * |
| Every 5 minutes, starting at minute 2 (:02, :07, :12…) | 2-59/5 * * * * |
| Every 5 minutes from 09:00 to 17:55 | */5 9-17 * * * |
| Every 5 minutes on weekdays only | */5 * * * 1-5 |
| Every 5 minutes during working hours on weekdays | */5 9-17 * * 1-5 |
| Every 10 minutes | */10 * * * * |
| Every 15 minutes | */15 * * * * |
Why offset the minute
Many jobs are scheduled at :00, :05 and :10, so shared servers and hosted schedulers are busiest at exactly those moments. Starting a few minutes later with 2-59/5 spreads the load and, on GitHub Actions, makes delayed or skipped runs less likely.
The same schedule on other platforms
- Linux crontab:
*/5 * * * * /usr/local/bin/sync.sh >> /var/log/sync.log 2>&1 - GitHub Actions:
- cron: "*/5 * * * *". Five minutes is the shortest interval GitHub allows, and runs can start late when GitHub is busy. - Kubernetes CronJob:
schedule: "*/5 * * * *". SetconcurrencyPolicy: Forbidif a run can take longer than five minutes. - Quartz, Spring and node-cron with seconds:
0 */5 * * * *(Spring) or0 0/5 * * * ?(Quartz), because these add a seconds field at the start. - systemd timer:
OnCalendar=*:0/5.
Avoid overlapping runs
Cron starts a new run every five minutes whether or not the last one has finished. If a run can take longer, wrap the command in flock so a second copy exits straight away: */5 * * * * flock -n /tmp/sync.lock /usr/local/bin/sync.sh.
Frequently asked questions
Is */5 the same as 0,5,10,15,20,25,30,35,40,45,50,55?
Yes. */5 is shorthand for that list. Both run at the same 12 minutes of every hour.
Does */5 run 5 minutes after the job starts?
No. Cron schedules are based on the clock, not on when the job was added, so */5 always runs at minutes divisible by 5. The first run is at the next such minute.
How do I run a job every 5 seconds?
Standard cron can't go below one minute. Use a loop inside the job, a systemd timer with OnUnitActiveSec=5s, or a scheduler that supports a seconds field.