Understanding Cron Expressions: A Practical Guide
By SyncBuilder
A cron expression is a compact way to schedule recurring jobs, such as backups, data syncs, and reports. It is the standard way to say run this every X, and once you can read one you can read them all.
The five fields
A cron expression has five fields, in this order: minute, hour, day-of-month, month, and day-of-week. Each field controls one part of the schedule, and an asterisk means every value for that field.
Syntax and examples
- Within a field: * means any value, */n means every n (a step), a-b means a range, and a,b,c means a list.
- */15 * * * * runs every 15 minutes.
- 0 9 * * 1-5 runs at 09:00 on weekdays.
- 0 0 1 * * runs at midnight on the first of each month.
- @daily is a shortcut for 0 0 * * *.
When BOTH day-of-month and day-of-week are set (neither is an asterisk), most cron implementations run the job when EITHER matches, not both. This is a classic source of jobs firing more often than expected.
Our free Cron Expression Helper breaks down each field and shows the next run times, so you can confirm the schedule right in your browser before you rely on it.
Try the free tool