Cron Expression Examples

84 crontab schedules with the exact times each one fires.

No signup, no tracking

Cron syntax is five small fields, and almost nobody writes it from memory. This is the lookup table: 84 working crontab schedules grouped by how often they fire, each one with a plain-English sentence describing exactly when it runs.

Every expression on this page was checked by enumerating a full calendar year of fire times, minute by minute, and comparing the result against its description. That includes the handful that do not mean what they appear to mean — those get their own section near the bottom.

How to read the five fields

A crontab line is five whitespace-separated fields followed by the command to run. Reading left to right, the fields get coarser: minute, hour, day of month, month, day of week.

* * * * *  command-to-run
| | | | |
| | | | +--- day of week   (0-7, 0 and 7 are Sunday)
| | | +----- month         (1-12, or JAN-DEC)
| | +------- day of month  (1-31)
| +--------- hour          (0-23)
+----------- minute        (0-59)
The standard five-field crontab layout.
FieldAllowed valuesNotes
Minute0-59The finest resolution cron offers.
Hour0-2324-hour clock; 0 is midnight.
Day of month1-31A 31 simply never matches in short months.
Month1-12 or JAN-DECNames are case-insensitive and always English.
Day of week0-7 or SUN-SATBoth 0 and 7 mean Sunday.

Four operators work in every field. An asterisk means every value. A comma builds a list (1,15). A hyphen builds a range (9-17). A slash adds a step, either to the whole field (*/5) or inside a range (8-18/2).

Every few minutes

The most looked-up schedules of all. One hard limit worth knowing up front: standard cron checks its table once a minute, so a minute is the shortest interval you can express. There is no way to write "every 30 seconds".

ExpressionWhen it runs
* * * * *Every minute
*/2 * * * *Every 2 minutes (:00, :02, :04 …)
*/5 * * * *Every 5 minutes
*/10 * * * *Every 10 minutes
*/15 * * * *Every 15 minutes
*/20 * * * *Every 20 minutes
*/30 * * * *Every 30 minutes
0,30 * * * *Every 30 minutes, written as a list
15,45 * * * *Twice an hour, at :15 and :45
5 * * * *Every hour at minute 5 (01:05, 02:05 …)
*/5 9-17 * * *Every 5 minutes between 09:00 and 17:55
*/15 * * * 1-5Every 15 minutes, Monday to Friday only
*/10 9-17 * * 1-5Every 10 minutes during office hours, weekdays

Every few hours

Put a fixed minute in the first field, then step the hour field. Leaving the minute as an asterisk here is a common accident: 0 */2 * * * runs twice a day at the top of the hour, while * */2 * * * runs 720 times a day.

ExpressionWhen it runs
0 * * * *Every hour, on the hour
30 * * * *Every hour at half past
0 */2 * * *Every 2 hours (00:00, 02:00 …)
0 */3 * * *Every 3 hours
0 */4 * * *Every 4 hours
0 */6 * * *Every 6 hours (00, 06, 12, 18)
0 */8 * * *Every 8 hours (00, 08, 16)
0 */12 * * *Every 12 hours (00:00 and 12:00)
15 */2 * * *Every 2 hours at quarter past
0 0,12 * * *Twice a day, midnight and noon
0 8,13,18 * * *Three times a day: 08:00, 13:00, 18:00
0 9-17 * * *Every hour from 09:00 to 17:00
0 9-17 * * 1-5Hourly during business hours, weekdays
0 8-18/2 * * 1-5Every 2 hours from 08:00 to 18:00, weekdays
0 0-6 * * *Hourly overnight, midnight to 06:00

Once or twice a day

Both the minute and the hour are pinned, so the job fires exactly once per matching day. These are the schedules for backups, report generation, cache warming and nightly imports.

ExpressionWhen it runs
0 0 * * *Every day at midnight
0 1 * * *Every day at 01:00
0 3 * * *Every day at 03:00 (typical backup window)
5 4 * * *Every day at 04:05
30 6 * * *Every day at 06:30
0 12 * * *Every day at noon
0 22 * * *Every day at 22:00
45 23 * * *Every day at 23:45
59 23 * * *Every day at 23:59, the last minute of the day
0 0 * * 1-5Every weekday at midnight
0 7 * * 1-5Every weekday at 07:00
0 9 * * 6,0Weekends only, at 09:00
0 20 * * 0-4Sunday to Thursday at 20:00

Specific days of the week

The fifth field takes 0-7 or the three-letter English names SUN, MON, TUE, WED, THU, FRI and SAT. Because both 0 and 7 map to Sunday, a range like 1-5 is Monday through Friday and 6,0 is the weekend.

ExpressionWhen it runs
0 0 * * 0Every Sunday at midnight
0 0 * * 7Every Sunday — 7 also means Sunday
0 0 * * SUNEvery Sunday, written with the day name
0 0 * * 1Every Monday at midnight
0 9 * * 1Every Monday at 09:00
30 8 * * 2,4Tuesdays and Thursdays at 08:30
0 12 * * 1,3,5Monday, Wednesday and Friday at noon
0 17 * * 5Every Friday at 17:00
0 0 * * 6Every Saturday at midnight
0 2 * * 0Every Sunday at 02:00
0 0 * * MON-FRIEvery weekday, written with day names
0 0 * * SAT,SUNWeekends only, at midnight
0 4 * * 1-5Every weekday at 04:00

Days of the month, months and years

Once you restrict the day-of-month or month fields, the job can fire as rarely as once a year. Watch the short months: an expression pinned to the 31st simply does not run in the five months that end on the 30th, and February drops two more.

ExpressionWhen it runs
0 0 1 * *At midnight on the 1st of every month
0 5 1 * *At 05:00 on the 1st of every month
0 0 15 * *At midnight on the 15th of every month
0 0 1,15 * *Twice a month, on the 1st and the 15th
0 0 28 * *On the 28th — the last day every month is guaranteed to have
0 0 */2 * *Every 2 days of the month (1st, 3rd, 5th …, restarts each month)
0 3 1 */3 *Quarterly: 03:00 on the 1st of Jan, Apr, Jul and Oct
0 0 1 1,4,7,10 *The same quarterly schedule, written as a list
0 0 1 */6 *Twice a year: 1 January and 1 July
0 0 1 1 *Once a year, at midnight on 1 January
0 0 25 12 *Once a year, at midnight on 25 December
0 0 1 JAN,JUL *Twice a year, written with month names
0 0 * 1 *Every day during January only
0 0 * 6-8 *Every day from June through August
0 0 29 2 *Only on 29 February — so only in leap years
0 0 1-7 * *Every day of the first week of the month

The @ shortcuts

Most cron implementations accept a handful of named shortcuts in place of the five fields. They are just aliases, so anything you can do with them you can also write out longhand.

ExpressionWhen it runs
@hourlySame as 0 * * * * — every hour on the hour
@dailySame as 0 0 * * * — every day at midnight
@midnightAn alias of @daily
@weeklySame as 0 0 * * 0 — Sundays at midnight
@monthlySame as 0 0 1 * * — the 1st at midnight
@yearlySame as 0 0 1 1 * — 1 January at midnight
@annuallyAn alias of @yearly

There is one more, @reboot, which runs the job once after the machine starts. It is deliberately missing from the table above because it is not a schedule at all — it has no next run time, so nothing can predict when it will fire.

Expressions that do not mean what they look like

These are all valid, and all of them regularly get written by someone expecting different behavior. The descriptions below are what actually happens.

ExpressionWhen it runs
0 0 1 * 1Fires on the 1st OR on every Monday — not both
0 0 1-7 * 1Days 1-7 OR every Monday — this is NOT "first Monday"
0 12 13 * 5Noon on the 13th and also every Friday
*/45 * * * *At :00 and :45 only — the step restarts each hour
0 */7 * * *At 00, 07, 14 and 21 — the 7-hour step also restarts daily
0 0 31 * *Only in months that have a 31st (7 months a year)
0 0 30 2 *Never runs — February never has a 30th

Three rules that explain most cron bugs

  1. A step counts from the start of the field, not from now. */45 does not mean "every 45 minutes" — it means minutes 0 and 45 of every hour, and the gap between the second run and the next is 15 minutes, not 45. The same applies to */7 in the hour field, which resets at midnight.
  2. When both the day-of-month and the day-of-week fields are restricted, cron runs the job when either one matches, not both. The crontab manual is explicit about this: "the command will be run when either field matches the current time." If only one of the two is restricted, the other being * means it is ignored and the behavior is the intuitive one.
  3. Cron uses the clock of the machine it runs on, and that is very often UTC even when you are not. A schedule that reads 03:00 to you may be running mid-afternoon on the server, so always confirm the host timezone before trusting an overnight window.

One more absence to plan around: standard Unix cron has no "last day of the month" syntax. The usual workaround is to schedule the job on the 28th, or to run it daily and let the command itself exit early unless tomorrow is the 1st. The L, W and # characters you may have seen belong to Quartz, a different scheduler with a six or seven field expression that starts with seconds.

Checking your own expression

A table can only cover the schedules people ask for most. When you have an expression that is not on this page — or you have edited one of these and want to be sure — paste it into the cron expression parser on this site. It names each field, turns the whole line into a sentence, previews the next five run times in your local timezone, and tells you which field is invalid when the expression will not parse at all. It runs entirely in your browser, so nothing you paste is uploaded anywhere.

Related tools