Monitoring7 min read

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.sh

Below 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.

The five fields of the cron expression */5 * * * *: minute, hour, day of month, month and day of week. */5 in the minute field means every fifth minute.
Five fields, read left to right: minute, hour, day of month, month, day of week.

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.
  • */n means every nth value: */5 in the minute field means every fifth minute.
  • a-b is a range: 1-5 in the day-of-week field means Monday to Friday.
  • a,b is a list: 9,17 in 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.

ScheduleCron expressionNotes
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 22-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.

ScheduleCron expressionNotes
Every hour, on the hour0 * * * *
Every hour at :3030 * * * *
Every 2 hours0 */2 * * *
Every 6 hours0 */6 * * *00:00, 06:00, 12:00, 18:00
Every day at midnight0 0 * * *
Every day at 2:30 am30 2 * * *
Twice a day (9 am and 5 pm)0 9,17 * * *
Weekdays at 9 am0 9 * * 1-5
Every 5 minutes, 9 am to 6 pm, weekdays*/5 9-17 * * 1-5last run 17:55
Every Sunday at midnight0 0 * * 0
Every Monday at 8 am0 8 * * 1
First day of every month0 0 1 * *
1st and 15th of the month0 0 1,15 * *
Every 3 months (quarterly)0 0 1 */3 *Jan, Apr, Jul, Oct
Once a year, 1 January0 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:30

Every 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.sh

Last 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.sh

Common crontab mistakes

  • A star in the minute field. * 9 * * * runs every minute from 9:00 to 9:59. Use 0 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 * 5 runs 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 timedatectl before choosing the hour.
  • Unescaped % signs. A command like date +%F breaks 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 instead

Add 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>&1

Email 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.sh

MAILTO only works if the server can send mail

It needs a working mail setup on the server, which most cloud servers don't have. And it only fires when the job prints something, so it stays silent when the job never runs at all, which is the failure that matters most.

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.

Know the moment something breaks

Uptura monitors uptime, SSL, DNS, APIs, and your cron jobs around the clock — alerting you the moment a site goes down or a scheduled job stops running. Free, no credit card required.

Free forever · no credit card required