Skip to main content
Developer Tools August 3, 2026 · 6 min read

How to Write a Cron Expression: Cron Jobs Explained

Cron is the standard scheduler for Unix-like systems. Once you understand its five-field syntax, you can schedule any task — hourly database backups, nightly reports, weekly maintenance scripts — with a single line of text. Here's how it works.

The 5-Field Cron Syntax

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

An asterisk (*) means "every value". So * * * * * runs every minute, every day.

Special Syntax

Syntax Meaning Example
* Every value * = every minute/hour/day
, List of values 1,15,30 = at minutes 1, 15, and 30
- Range 1-5 = Monday through Friday
/ Step */15 = every 15 units; 0-23/2 = every 2 hours

Common Cron Expression Examples

0 * * * *

Every hour (at :00)

*/15 * * * *

Every 15 minutes

0 0 * * *

Every day at midnight

0 9 * * MON-FRI

Weekdays at 9:00 AM

0 0 1 * *

First day of every month at midnight

30 23 * * 5

Every Friday at 11:30 PM

0 0 * * 0

Every Sunday at midnight

0 9,17 * * *

Every day at 9 AM and 5 PM

*/5 8-18 * * 1-5

Every 5 min, 8am–6pm, weekdays only

0 0 1 1 *

Once a year, January 1st at midnight

Special Nicknames (crontab shorthand)

@reboot

Run once at startup (not a time schedule)

@hourly

0 * * * * — every hour at :00

@daily / @midnight

0 0 * * * — every day at midnight

@weekly

0 0 * * 0 — every Sunday at midnight

@monthly

0 0 1 * * — 1st of every month at midnight

@yearly / @annually

0 0 1 1 * — January 1st at midnight

Cron in Cloud and Modern Platforms

GitHub Actions

Uses a slightly different syntax with 5 fields under "on: schedule: cron:". Minimum interval: 5 minutes (though GitHub may delay by up to 15 min under load).

AWS EventBridge (CloudWatch Events)

Supports both cron and rate expressions: cron(0 12 * * ? *) or rate(5 minutes). Note: uses ? for "no specific value" instead of *.

Kubernetes CronJobs

Standard 5-field cron in the spec.schedule field. Optional: startingDeadlineSeconds and concurrencyPolicy to control overlap.

Vercel Cron

Supports standard 5-field cron via vercel.json crons array. Minimum interval: 1 minute on Pro plans.

Build cron expressions visually — free

⏰ Cron Generator