Cron expression examples and syntax guide
Cron expressions schedule recurring jobs across Unix systems, CI pipelines, and cloud platforms, but their five terse fields are easy to misread — and a wrong field can run a job every minute instead of once a day. This guide explains each field and symbol, then gives copy-ready expressions for the schedules people actually need. Check any expression in the Cron Expression Parser before you deploy it.
The five fields
A standard cron expression has five fields separated by spaces. From left to right they are minute, hour, day of month, month, and day of week. All five are required, so a schedule that only cares about the time of day still uses * in the date fields.
* * * * *
| | | | |
| | | | +-- day of week (0-6, Sunday = 0)
| | | +---- month (1-12)
| | +------ day of month (1-31)
| +-------- hour (0-23)
+---------- minute (0-59)Special symbols
Each field accepts more than a single number. These symbols are what make cron expressive, and they can be combined in one field, as in 0-30/10,45.
| Symbol | Meaning | Example |
|---|---|---|
* | Every value | * in minute = every minute |
*/n | Every n (a step) | */15 in minute = 0, 15, 30, 45 |
a-b | A range | 1-5 in day of week = Monday through Friday |
a,b | A list | 1,15 in day of month = the 1st and 15th |
a-b/n | A range with a step | 0-30/10 in minute = 0, 10, 20, 30 |
Common schedules
Copy-ready expressions for the schedules people ask for most. Copy any of them, or open it in the Cron Expression Parser to see its next run times.
| Expression | Runs | Actions |
|---|---|---|
* * * * * | Every minute | |
*/15 * * * * | Every 15 minutes | |
0 * * * * | Every hour, on the hour | |
0 */2 * * * | Every 2 hours, on the hour | |
0 9 * * * | Every day at 09:00 | |
0 9 * * 1-5 | Weekdays at 09:00 | |
30 17 * * 5 | Every Friday at 17:30 | |
0 0 * * 0 | Every Sunday at midnight | |
0 0 1 * * | Midnight on the 1st of each month | |
0 0 1,15 * * | Midnight on the 1st and 15th of each month | |
0 0 1 1 * | Midnight on 1 January |
A common gotcha
When both the day-of-month and day-of-week fields are restricted — neither one starts with * — most cron implementations, including Vixie cron and cronie on Linux, run the job when either field matches, not only when both do. 0 0 13 * 5 runs at midnight on every 13th of the month and on every Friday, not only on Friday the 13th. The Cron Expression Parser applies the same rule, so check its next run times whenever you set both fields.
Also confirm the time zone: many schedulers run in UTC, so 0 0 * * * fires at midnight UTC, which may be a different local time than you expect. The parser can list run times in your local time or in UTC.
Shortcuts, names, and other formats
Vixie cron and cronie, the cron daemons on most Linux systems, accept a few extras beyond plain numbers:
@hourly,@daily(also@midnight),@weekly,@monthly, and@yearly(also@annually) are shortcuts for0 * * * *,0 0 * * *,0 0 * * 0,0 0 1 * *, and0 0 1 1 *.@rebootruns a job once when the cron daemon starts, instead of on a calendar schedule.- Three-letter names work in the month and day-of-week fields:
JANtoDECandSUNtoSAT, in any letter case. 7also means Sunday in the day-of-week field, so0 0 * * 7and0 0 * * 0are the same schedule.
Schedulers with a different format
Not every scheduler uses the standard five fields. An expression that is valid in one can be rejected by another, or mean something else:
- Quartz (Java) adds a seconds field at the start, giving six or seven fields. It numbers the days of the week 1 to 7 starting with Sunday, and requires
?in either the day-of-month or the day-of-week field. - Spring's
@Scheduledcron expressions also start with a seconds field, giving six fields. - AWS EventBridge rules use six fields: minutes, hours, day of month, month, day of week, and year. Days of the week run 1 to 7 starting with Sunday, one of the two day fields must be
?, and schedules run in UTC. - GitHub Actions workflows and Kubernetes CronJobs use the standard five fields.
Frequently asked questions
What do the five cron fields mean?
In order: minute, hour, day of month, month, and day of week. Each accepts a number, a range, a list, a step, or a star for every value.
How do I run a job every N minutes?
Use a step in the minute field: */15 * * * * runs every fifteen minutes and */5 * * * * every five.
Do cron times use UTC or local time?
It depends on the system running the job. Many run in UTC, so always confirm the time zone of the scheduler that executes the expression.
Why did my job run more often than expected?
When both day of month and day of week are restricted, most cron systems run the job when either one matches: 0 0 13 * 5 runs on every 13th and on every Friday. Check the parsed schedule to be sure.
Can cron run a job every few seconds?
Not standard cron: its smallest unit is one minute. Schedulers with a seconds field, such as Quartz and Spring, can run more often.