Cron Every 5 Minutes: Crontab Examples for Every Schedule
The cron expression for every 5 minutes is */5 * * * *. Copy-paste crontab examples for every minute, hourly, daily, weekly and monthly, plus common mistakes.
The cron expression for every 5 minutes is */5 * * * *. Put it in front of your command in the crontab and the job runs at :00, :05, :10 and so on, every hour of the day.
*/5 * * * * /usr/local/bin/sync.shBelow are copy-paste crontab examples for every common schedule, from every minute to once a year, plus the mistakes that make a correct-looking line run at the wrong time (or not at all). To build or check an expression without memorizing the syntax, use our free cron expression generator.
How to read a cron expression
A cron expression has five fields separated by spaces. Each field says when the job is allowed to run, and the job runs when all five match.
- Minute (0–59)
- Hour (0–23, in the server's time zone)
- Day of month (1–31)
- Month (1–12)
- Day of week (0–7, where both 0 and 7 are Sunday)
Four symbols cover almost every schedule:
*means every value: a star in the hour field means every hour.*/nmeans every nth value:*/5in the minute field means every fifth minute.a-bis a range:1-5in the day-of-week field means Monday to Friday.a,bis a list:9,17in the hour field means 9 am and 5 pm.
Every minute, every 5 minutes, every 15 minutes
Minute-based schedules all use the first field. Cron's shortest interval is one minute.
| Schedule | Cron expression | Notes |
|---|---|---|
| Every minute | * * * * * | |
| Every 2 minutes | */2 * * * * | |
| Every 5 minutes | */5 * * * * | at :00, :05, :10 … :55 |
| Every 10 minutes | */10 * * * * | |
| Every 15 minutes | */15 * * * * | at :00, :15, :30, :45 |
| Every 30 minutes | */30 * * * * | same as 0,30 * * * * |
| Every 5 minutes, offset by 2 | 2-59/5 * * * * | at :02, :07, :12 … |
The offset version, 2-59/5, is useful when many jobs run every 5 minutes. Spreading them across different minutes stops them all hitting the database at the same second.
Hourly, daily, weekly and monthly
For anything slower than every minute, set the minute field to a fixed number. Leaving it as * is the most common crontab mistake: * 2 * * * runs 60 times between 2:00 and 2:59, not once at 2 am.
| Schedule | Cron expression | Notes |
|---|---|---|
| Every hour, on the hour | 0 * * * * | |
| Every hour at :30 | 30 * * * * | |
| Every 2 hours | 0 */2 * * * | |
| Every 6 hours | 0 */6 * * * | 00:00, 06:00, 12:00, 18:00 |
| Every day at midnight | 0 0 * * * | |
| Every day at 2:30 am | 30 2 * * * | |
| Twice a day (9 am and 5 pm) | 0 9,17 * * * | |
| Weekdays at 9 am | 0 9 * * 1-5 | |
| Every 5 minutes, 9 am to 6 pm, weekdays | */5 9-17 * * 1-5 | last run 17:55 |
| Every Sunday at midnight | 0 0 * * 0 | |
| Every Monday at 8 am | 0 8 * * 1 | |
| First day of every month | 0 0 1 * * | |
| 1st and 15th of the month | 0 0 1,15 * * | |
| Every 3 months (quarterly) | 0 0 1 */3 * | Jan, Apr, Jul, Oct |
| Once a year, 1 January | 0 0 1 1 * |
Shortcuts: @hourly, @daily, @weekly
Most cron versions on Linux (Vixie cron and cronie) also accept named schedules in place of the five fields:
@reboot /usr/local/bin/start-worker.sh # once, when the server boots
@hourly /usr/local/bin/job.sh # same as 0 * * * *
@daily /usr/local/bin/job.sh # same as 0 0 * * *
@weekly /usr/local/bin/job.sh # same as 0 0 * * 0
@monthly /usr/local/bin/job.sh # same as 0 0 1 * *
@yearly /usr/local/bin/job.sh # same as 0 0 1 1 *Schedules cron can't write directly
Every 90 minutes
Steps restart every hour, so there's no single expression for every 90 minutes. Use two lines that together cover the pattern:
0 0-21/3 * * * /usr/local/bin/job.sh # 00:00, 03:00, 06:00 … 21:00
30 1-22/3 * * * /usr/local/bin/job.sh # 01:30, 04:30, 07:30 … 22:30Every 30 seconds
Run the job at the start of each minute and again 30 seconds later:
* * * * * /usr/local/bin/job.sh
* * * * * sleep 30; /usr/local/bin/job.shLast day of the month
Standard cron has no “last day” option. Run it on days 28–31 and let the command check whether tomorrow is the 1st. Note the escaped \%: in a crontab, a bare % means a new line.
0 23 28-31 * * [ "$(date -d tomorrow +\%d)" = "01" ] && /usr/local/bin/month-end.shCommon crontab mistakes
- A star in the minute field.
* 9 * * *runs every minute from 9:00 to 9:59. Use0 9 * * *for once at 9 am. - Day of month and day of week together. If both are set, cron runs when either matches.
0 0 13 * 5runs on every 13th and on every Friday, not only on Friday the 13th. - The wrong time zone. Cron uses the server's time zone, which is often UTC on cloud servers. Check it with
timedatectlbefore choosing the hour. - Unescaped % signs. A command like
date +%Fbreaks in a crontab. Write\%F, or move the command into a script. - Missing PATH. Cron runs with a minimal environment, so commands that work in your shell may not be found. Use full paths like
/usr/bin/php.
If a job still isn't firing, our guide to a cron job not running walks through the logs and the ten usual causes.
How to add a cron job
crontab -e # edit your crontab (opens in your editor)
crontab -l # list your current jobs
sudo crontab -e # edit root's crontab insteadAdd one line per job, save, and cron picks it up without a restart. To keep the output, send it to a log file:
*/5 * * * * /usr/local/bin/sync.sh >> /var/log/sync.log 2>&1Email when a job fails: MAILTO
Cron emails any output a job prints to the address in MAILTO, at the top of the crontab:
MAILTO="[email protected]"
0 2 * * * /usr/local/bin/backup.shMAILTO only works if the server can send mail
Know when a scheduled job stops running
A job that runs every 5 minutes can stop for days before anyone notices: cron gets disabled during a server move, the script starts failing, or the server reboots without the crontab. The reliable fix is a check-in. Add a request to the end of the job, and a monitor alerts you when it stops arriving:
*/5 * * * * /usr/local/bin/sync.sh && curl -fsS -m 10 --retry 3 -o /dev/null https://backend.uptura.io/hb/<your-token>The && means the check-in only happens when the job succeeds, so a failing run and a run that never happened both trigger an alert. Uptura's cron job monitoring works this way. The free plan covers 3 jobs that run every 15 minutes or slower, with email alerts; Pro checks jobs that run as often as every minute. For nightly backups specifically, see our guide to backup monitoring.
Cron Schedule FAQ
What is the cron expression for every 5 minutes?
*/5 * * * *. The */5 in the minute field means every fifth minute, so the job runs at :00, :05, :10 and so on through :55, every hour of every day. In a crontab the full line is */5 * * * * followed by the command, for example */5 * * * * /usr/local/bin/sync.sh.
What is the cron expression for every minute?
* * * * *. Five stars mean every minute of every hour of every day. One minute is the shortest interval cron supports. For anything faster you need a loop in your script or a systemd timer.
What is the cron expression for every hour?
0 * * * *. It runs at minute 0 of every hour: 00:00, 01:00, 02:00 and so on. To run at a different minute past the hour, change the first field, for example 15 * * * * for quarter past every hour.
Does */5 run exactly every 5 minutes?
It runs on minutes divisible by 5 (:00, :05, :10 …), not 5 minutes after the crontab was saved. Because 60 divides evenly by 5, the gap is always exactly 5 minutes. With steps that don't divide 60, like */7, the gap resets each hour: the job runs at :56 and then again at :00, only 4 minutes later.
How do I run a cron job every 30 seconds?
Cron can't schedule below one minute. The common workaround is two lines: * * * * * /path/job.sh and * * * * * sleep 30; /path/job.sh. The first runs at the start of each minute and the second 30 seconds later. For anything more frequent, a systemd timer or a long-running process is a better fit.
How do I know if my cron job ran?
Check the system log (grep CRON /var/log/syslog on Ubuntu, or journalctl -u crond on RHEL-based systems), or redirect the job's output to a log file. To be told automatically when a job stops running, add a check-in call to the end of the job and use a cron job monitoring tool, which alerts you when the check-in doesn't arrive.