Cron Every 5 Minutes
The expression */5 * * * * runs a job every five minutes; here it is explained with its next run times.
Run a Cron Job Every 5 Minutes
Checking a queue, syncing a feed or polling an API every few minutes is one of the most common cron schedules. This page opens the Cron Expression Explainer with */5 * * * * filled in, so you can see exactly when it fires and adjust it before it goes live.
Variations
| Expression | Runs |
|---|---|
*/5 * * * * | Every 5 minutes, all day |
*/5 9-17 * * * | Every 5 minutes from 09:00 to 17:55 |
*/5 * * * 1-5 | Every 5 minutes on weekdays |
2-59/5 * * * * | Every 5 minutes, offset to minute 2, 7, 12… |
The offset form is useful when many jobs share a server: starting them all at minute 0 creates a load spike every five minutes.
A crontab line
In a crontab the schedule is followed by the command, for example */5 * * * * /usr/local/bin/sync.sh >> /var/log/sync.log 2>&1. Redirecting output to a log matters: otherwise cron tries to email it, and errors disappear.
Related schedules
For less frequent jobs, see every hour and every day at midnight.