Cron Every 5 Minutes (and 20 More Schedules to Copy)

Suman SharmaSuman Sharma

The short answer:

*/5 * * * * /path/to/command

That runs at :00, :05, :10 and so on, every hour of every day. The rest of this page lists the schedules people search for most, then explains the fields so you can write your own. To check any expression in plain English, paste it into the Cron Expression Explainer.

The five fields

┌───────────── minute (0–59) │ ┌─────────── hour (0–23) │ │ ┌───────── day of month (1–31) │ │ │ ┌─────── month (1–12) │ │ │ │ ┌───── day of week (0–6, Sunday = 0; 7 is also Sunday on most systems) │ │ │ │ │ * * * * * command
SymbolMeaningExample
*every value* in hour = every hour
,list1,15 = the 1st and 15th
-range1-5 = Monday to Friday
/step*/10 = every 10th value

Minute and hour schedules

ScheduleExpression
Every minute* * * * *
Every 2 minutes*/2 * * * *
Every 5 minutes*/5 * * * *
Every 10 minutes*/10 * * * *
Every 15 minutes*/15 * * * *
Every 30 minutes*/30 * * * *
Every hour, on the hour0 * * * *
Every hour at :3030 * * * *
Every 2 hours0 */2 * * *
Every 6 hours0 */6 * * *

A common slip: * */2 * * * runs every minute during every second hour. If you want once every two hours, set the minute to 0.

Daily, weekly and monthly schedules

ScheduleExpression
Every day at midnight0 0 * * *
Every day at 9:000 9 * * *
Twice a day (9:00 and 18:00)0 9,18 * * *
Weekdays at 9:000 9 * * 1-5
Weekends at 10:000 10 * * 0,6
Every Monday at 8:000 8 * * 1
First day of the month at midnight0 0 1 * *
1st and 15th at noon0 12 1,15 * *
Every 5 minutes during work hours, weekdays*/5 9-17 * * 1-5
Once a year, 1 January0 0 1 1 *

Shortcuts

Most cron implementations (Vixie cron, cronie, macOS) accept these:

ShortcutSame as
@hourly0 * * * *
@daily0 0 * * *
@weekly0 0 * * 0
@monthly0 0 1 * *
@yearly0 0 1 1 *
@rebootonce at startup

Hosted schedulers (GitHub Actions, Vercel, Kubernetes CronJobs) usually accept the five-field form but not always the @ shortcuts, so the five-field version is the safer choice.

The day-of-month and day-of-week trap

If you set both day of month and day of week, classic cron runs the job when either matches, not both. 0 9 1 * 1 runs on the 1st of the month and on every Monday. To run "the first Monday of the month", schedule it for Mondays and check the date inside the script:

0 9 * * 1 [ "$(date +\%d)" -le 07 ] && /path/to/command

Note the \%. In a crontab line, an unescaped % is treated as a newline, which silently breaks the command.

Other mistakes that bite

  1. Time zone. Cron uses the server's time zone, and hosted schedulers usually use UTC. See Why Your Cron Job Ran at the Wrong Time.
  2. PATH. Cron runs with a minimal environment. Use absolute paths (/usr/bin/node, not node).
  3. No output. Redirect logs so you can see failures: */5 * * * * /path/script.sh >> /var/log/script.log 2>&1.
  4. Overlapping runs. If a job can take longer than its interval, wrap it in flock -n /tmp/job.lock so a second copy doesn't start.

Editing your crontab

crontab -e # edit crontab -l # list

Frequently asked questions

What is the cron expression for every 5 minutes?

*/5 * * * * runs at minute 0, 5, 10, 15 and so on, every hour of every day.

What does */5 mean in cron?

The slash is a step. */5 in the minute field means every value from 0 to 59 that is divisible by 5. 10-30/5 would mean 10, 15, 20, 25 and 30.

Can cron run every 30 seconds?

Not directly. Standard cron's smallest unit is one minute. You can run two entries, one of them with sleep 30 before the command, or use a systemd timer or a process scheduler instead.

Contact

Get in Touch

Want to call me? book a call and I'll respond in the available time slot. I will ignore all soliciting.