• Cron
  • DevOps
  • Reference

Cron syntax explained, with 20 copy-paste schedules

How the five cron fields work, the special characters that trip people up, and 20 ready-made schedules, from every 5 minutes to the last day of the month.

The utilyx team9 min read
On this page

Cron expressions are five tiny fields that decide when your backups run, your reports send, and your caches clear. They're easy to write and easy to get subtly wrong: a job that runs every minute of the hour instead of once, or at 9am UTC instead of 9am for your users.

This guide covers how the fields work, the characters that cause most mistakes, and 20 schedules you can copy.

The five fields

text
┌───────────── minute        (0–59)
│ ┌─────────── hour          (0–23)
│ │ ┌───────── day of month  (1–31)
│ │ │ ┌─────── month         (1–12)
│ │ │ │ ┌───── day of week   (0–6, Sunday = 0; many systems also accept 7)
│ │ │ │ │
* * * * *

A job runs when every field matches the current time, with one important exception for the two day fields, covered below.

The special characters

CharacterMeaningExampleReads as
*Every value* * * * *Every minute
,A list0 9,17 * * *At 09:00 and 17:00
-A range0 9 * * 1-509:00, Monday to Friday
/A step*/15 * * * *Every 15 minutes

You can combine them: 0 9-17/2 * * 1-5 means every two hours from 09:00 to 17:00 on weekdays (9, 11, 13, 15, 17).

Most cron implementations also accept names for months and weekdays, such as JAN or MON. Numbers work everywhere, so they're the safer choice.

20 schedules to copy

Every few minutes or hours

ScheduleExpression
Every 5 minutes*/5 * * * *
Every 15 minutes*/15 * * * *
Every hour, on the hour0 * * * *
Every 2 hours0 */2 * * *
Every 30 minutes during working hours, weekdays*/30 9-17 * * 1-5
Every hour from 09:00 to 17:00, weekdays0 9-17 * * 1-5

Daily

ScheduleExpression
Every day at midnight0 0 * * *
Every day at 02:3030 2 * * *
Twice a day, 00:00 and 12:000 0,12 * * *
Every weekday at 09:000 9 * * 1-5
Every weekday at 22:000 22 * * 1-5
Weekends at 03:000 3 * * 0,6

Weekly

ScheduleExpression
Every Monday at 09:000 9 * * 1
Every Friday at 18:000 18 * * 5
Every Sunday at midnight0 0 * * 0

Monthly and yearly

ScheduleExpression
First day of every month at midnight0 0 1 * *
15th of every month at 09:000 9 15 * *
First day of every quarter0 0 1 1,4,7,10 *
Every 1 January at midnight0 0 1 1 *
Last day of the month (see below)0 0 28-31 * * + a check

Five gotchas that cause most cron bugs

1. * in the minute field means every minute

text
* 9 * * *

This doesn't run at 9am. It runs 60 times, every minute from 09:00 to 09:59. If you want once, set the minute: 0 9 * * *.

2. Day-of-month and day-of-week are OR, not AND

You might expect this to mean "Friday the 13th":

text
0 0 13 * 5

In standard (Vixie) cron, when both day fields are restricted, the job runs if either matches: every 13th of the month and every Friday. To get "Friday the 13th", schedule one field and check the other in your script:

bash
0 0 13 * * [ "$(date +\%u)" = 5 ] && /path/to/job.sh

Note the \%: inside a crontab, a bare % means "new line", so it has to be escaped.

3. There's no "last day of the month" in standard cron

L (as in 0 0 L * *) works in Quartz and some cloud schedulers, but not in classic cron. The portable trick is to run on days 28–31 and check whether tomorrow is the 1st:

bash
0 0 28-31 * * [ "$(date -d tomorrow +\%d)" = 01 ] && /path/to/job.sh

date -d tomorrow is GNU date, which is what most Linux servers have. On macOS and BSD, use date -v+1d +%d.

4. Time zones

Cron uses the time zone of whatever runs it, and that's often UTC, not yours.

  • A Linux server uses the system time zone, so check it with timedatectl. Some cron versions accept a CRON_TZ= line at the top of the crontab.
  • GitHub Actions runs schedules in UTC by default. A 2026 update added an optional time zone setting per schedule, so check the docs for your setup. The minimum interval is every 5 minutes, and runs can be delayed when GitHub is busy, so avoid exactly :00 for jobs that matter.
  • Kubernetes CronJobs use .spec.timeZone (stable since v1.27) with names like "Asia/Dhaka". Putting CRON_TZ or TZ inside schedule is rejected.

If daylight saving applies, a job at 02:30 can run twice or not at all on the night the clocks change. Schedule important jobs outside 01:00–03:00, or run them in UTC.

5. Not every "cron" is the same cron

SystemFieldsNotes
Linux crontab5The baseline in this guide
GitHub Actions5UTC by default, minimum 5 minutes
Kubernetes5Time zone in a separate field
Quartz (Java), Spring6 or 7Adds seconds first, optional year, uses ?
AWS EventBridge6Adds year at the end, requires ? in one day field

A Quartz expression like 0 0 9 * * ? (09:00 daily) is invalid in a crontab, and a crontab line pasted into Spring will run at the wrong time. Always check which flavour your platform expects.

Shortcuts

Many cron implementations accept named shortcuts:

ShortcutSame as
@hourly0 * * * *
@daily0 0 * * *
@weekly0 0 * * 0
@monthly0 0 1 * *
@yearly0 0 1 1 *
@rebootOnce, at startup

They're readable, but not universal: GitHub Actions, for example, doesn't support them. When in doubt, write the five fields.

Check before you deploy

Before a schedule goes live, read it back in plain words and look at its next few run times. Most cron bugs are obvious the moment you see "next run: every minute between 09:00 and 09:59".

The utilyx cron parser does both as you type: it explains the expression in plain English and lists the next runs in your time zone and in UTC. It runs in your browser, so nothing about your infrastructure leaves your machine.

Try the Cron parser
Free, no sign-up, and it runs in your browser.
Open the tool →