A cron expression is five fields separated by spaces. Each field controls one part of the schedule, and together they answer a single question: at which minutes should this job run? The expression for every 5 minutes is */5 * * * *. The rest of this guide explains why, so you can write any schedule yourself.
The five fields
Reading left to right, a cron line looks like this:
* * * * *
│ │ │ │ │
│ │ │ │ └── day of week (0-6, Sun=0; or SUN-SAT)
│ │ │ └──── month (1-12; or JAN-DEC)
│ │ └────── day of month (1-31)
│ └──────── hour (0-23)
└────────── minute (0-59)An asterisk (*) means “every value”. So * * * * * runs once a minute, forever.
The four operators every field accepts
*: every value.* * * * *is every minute.,: a list.0 9,17 * * *runs at 09:00 and 17:00.-: a range.0 9-17 * * *runs hourly from 09:00 through 17:00./: a step.*/5in the minute field means every 5th minute. Steps can follow a range too:0-30/10is 0, 10, 20, 30.
Copy-paste examples
*/5 * * * * every 5 minutes
*/10 * * * * every 10 minutes
0 * * * * every hour, on the hour
0 */2 * * * every 2 hours
0 0 * * * every day at midnight
30 8 * * * every day at 08:30
0 9 * * 1-5 weekdays at 09:00
0 0 * * 0 every Sunday at midnight
0 0 1 * * the 1st of every month at midnight
0 9-17 * * 1-5 hourly, 09:00-17:00, Mon-FriWhy every 5 minutes is */5 * * * *
The step operator does the work. */5 in the minute field expands to 0,5,10,15,20,25,30,35,40,45,50,55. Every other field is *, so the schedule places no restriction on the hour, day, month or weekday. The job therefore fires at those twelve minute-marks of every hour.
A common mistake is writing 5 * * * *, which runs only at minute 5 of each hour, once an hour, not every five minutes. The slash is what makes it a repeating step.
Two gotchas worth knowing
Day-of-month OR day-of-week. If both of those fields are set to something other than *, the job runs when either matches. 0 0 13 * 5 runs on the 13th and on every Friday, not only on Friday the 13th.
Time zones. Cron interprets the expression in the server’s time zone. If that server runs UTC and you think in local time, your 9 a.m. job may fire at a surprising hour, and during daylight-saving transitions some local times occur twice or not at all.
The fastest way to be sure an expression does what you meant is to see its next run times spelled out. Paste it into our free cron expression generator, which explains each field in plain English and lists the next five runs.