Cron Expressions Explained: The Five Fields, With Examples
A cron expression has five fields: minute, hour, day of month, month, day of week. Ranges, steps, lists, the day OR rule, macros and the time zone trap.
*/15 9-17 * * 1-5 means “every 15 minutes, from 9:00 to 17:45, Monday to Friday”. A cron expression is five fields separated by spaces, read left to right as minute, hour, day of month, month and day of week. A job runs when the current time matches all five fields, with one exception for the two day fields that is covered below.
The five fields
| Position | Field | Allowed values |
|---|---|---|
| 1 | Minute | 0 to 59 |
| 2 | Hour | 0 to 23 (0 is midnight) |
| 3 | Day of month | 1 to 31 |
| 4 | Month | 1 to 12, or JAN to DEC |
| 5 | Day of week | 0 to 6 with 0 as Sunday, or SUN to SAT; many implementations also accept 7 as Sunday |
This is the format of the POSIX crontab utility. Month and day names, steps and 7 as Sunday come from Vixie cron and are described in crontab(5). Some systems add fields for seconds or the year, so check your scheduler’s dialect first.
The four special characters
| Syntax | Meaning | Example | Result |
|---|---|---|---|
* |
Every value in the field | * * * * * |
Every minute |
, |
A list of values | 0,30 * * * * |
At minute 0 and minute 30 of every hour |
- |
An inclusive range | 0 9-17 * * * |
At the top of each hour from 9 to 17, which is 9 runs a day |
/ |
A step | */15 * * * * |
Minutes 0, 15, 30 and 45, which is 96 runs a day |
A step is applied to a range. */15 is “every 15th value across the whole field”, and 0-30/10 is “every 10th value from 0 to 30”, which gives minutes 0, 10, 20 and 30. Steps start counting at the beginning of the range, not at the moment the job was installed, so */45 in the minute field runs at minutes 0 and 45 of every hour, not every 45 minutes. A gap that does not divide evenly into 60 minutes or 24 hours never produces an even interval, which is why “every 90 minutes” cannot be written as a single five-field expression.
Common schedules
| Expression | Runs |
|---|---|
* * * * * |
Every minute |
*/5 * * * * |
Every 5 minutes |
0 * * * * |
At the start of every hour |
0 0 * * * |
Every day at midnight |
0 9-17 * * 1-5 |
On the hour from 09:00 to 17:00, Monday to Friday (45 runs a week) |
0 0 * * 0 |
Every Sunday at midnight |
0 0 1 * * |
At midnight on the first of every month |
Macros: @daily and friends
Vixie cron and its descendants accept shortcuts that stand for a five-field expression:
| Macro | Same as | Meaning |
|---|---|---|
@yearly or @annually |
0 0 1 1 * |
Once a year, at midnight on 1 January |
@monthly |
0 0 1 * * |
Midnight on the first of the month |
@weekly |
0 0 * * 0 |
Midnight on Sunday |
@daily or @midnight |
0 0 * * * |
Every day at midnight |
@hourly |
0 * * * * |
At the start of every hour |
There is also @reboot, which runs once when the cron daemon starts. It has no schedule, so it cannot be turned into a list of run times. Macros are not part of POSIX, so a hosted scheduler may reject @daily even where a Linux crontab accepts it.
The day-of-month and day-of-week rule
When both day fields are restricted (neither starts with *), cron runs the job when either one matches, not when both do. This is the rule in POSIX, and it surprises almost everyone.
| Expression | What people expect | What runs |
|---|---|---|
0 0 13 * FRI |
Only on Friday the 13th | On every 13th and on every Friday |
0 9 1-7 * MON |
The first Monday of the month | On days 1 to 7 and on every Monday |
Worked example for December 2026. The 13th falls on a Sunday and the Fridays are the 4th, 11th, 18th and 25th. So 0 0 13 * FRI runs on 5 days that month: the 4th, 11th, 13th, 18th and 25th. The first-Monday expression is worse. In November 2026 it runs on days 1 to 7 plus Mondays 9, 16, 23 and 30, which is 11 days instead of one.
If you want “first Monday”, schedule the job for every Monday (0 9 * * MON) and have the script itself check that the day of the month is 7 or less. Vixie cron and cronie also treat a field that begins with a star, such as */2, as unrestricted, so a step in the day-of-month field combined with a weekday is joined with AND instead.
The time zone gotcha
An expression has no time zone of its own. It is evaluated in whatever zone the scheduler uses, and that is not always the zone of the person who wrote it.
- Classic
crontabuses the system time zone of the machine. - Many hosted schedulers use UTC. GitHub Actions scheduled workflows, for example, run on UTC time.
- A job at
30 2 * * *in a zone with daylight saving time can be skipped or run twice on the nights the clocks change, because 02:30 may not exist in spring or may occur twice in autumn. How a given cron handles this differs between implementations.
Write the zone down next to the expression, and avoid the small hours on nights when clocks change. Running the server and the schedule in UTC removes the problem, at the cost of converting to local time when you read it.
Common mistakes
- Writing
* 9 * * *to mean “once at 9:00”. It means every minute during the 9 o’clock hour, 60 runs. Put a number in the minute field:0 9 * * *. - Counting from 1 in the day-of-week field. Sunday is 0 (or 7), Monday is 1 and Saturday is 6.
Try it
Paste any expression, or one of the macros above, into the cron expression explainer. It checks each field, explains the schedule in a sentence, and lists the next run times so you can confirm the job fires when you intend before it goes into production.
Updated 2026-11-02