Resources / Serverless

Cron expression examples: a cheat sheet for every schedule

Cron syntax explained with copy-paste examples — every 5 minutes, hourly, weekdays at 9am, the first of the month — plus time zones and common mistakes.

A cron expression is five fields that describe when something runs:

┌───────────── minute        (0–59)
│ ┌─────────── hour          (0–23)
│ │ ┌───────── day of month  (1–31)
│ │ │ ┌─────── month         (1–12 or JAN–DEC)
│ │ │ │ ┌───── day of week   (0–6, Sunday = 0, or SUN–SAT)
│ │ │ │ │
* * * * *

Special characters

SymbolMeansExample
*Every value* in hours = every hour
,A list1,15 = the 1st and the 15th
-A range1-5 = Monday to Friday
/A step*/15 = every 15

Copy-paste examples

ScheduleCron
Every 5 minutes*/5 * * * *
Every 15 minutes*/15 * * * *
Every hour, on the hour0 * * * *
Every 2 hours0 */2 * * *
Every day at midnight0 0 * * *
Every day at 9:30am30 9 * * *
Weekdays at 9am0 9 * * 1-5
Every Monday at 8am0 8 * * 1
Twice a day (9am and 5pm)0 9,17 * * *
First day of every month at 6am0 6 1 * *
Every Sunday at 11pm0 23 * * 0
First Monday of the month*0 9 1-7 * 1 (see below)
Every quarter (Jan, Apr, Jul, Oct) at midnight on the 1st0 0 1 1,4,7,10 *

The gotchas

Nonstandard extensions

Some schedulers add a seconds field (six fields), or shortcuts like @daily, @hourly, L (last day) and # (1#1 = first Monday). They aren't portable — check what your scheduler supports.

Schedules on Wisp

On Wisp you can skip the syntax: describe the schedule — "every weekday at 9am Berlin time" — and Wisp writes the task and turns it into a cron expression in your time zone. You can also type a cron expression in the task's settings. Schedules run the published version, at most every 5 minutes, and every run is logged with alerts when it fails. See scheduled jobs without a server.

Try it: Cron expression generator · Every common cron schedule, explained

Build it with Wisp — describe an API, get it live.

Related