Cron examples

Cron expression examples

76 cron expression and crontab examples for the schedules people write every day, from every minute to once a year, plus the ones a single cron line cannot express. Each page explains the expression, shows the crontab line, previews its runs, and shows how to watch it.

Every few minutes

Hourly and every few hours

Once or a few times a day

Weekdays, weekends and weekly

Business hours

Monthly

Quarterly and yearly

Schedules one cron line cannot write

Quartz and Spring

Questions and answers

What is a cron expression?
A line of five fields, minute, hour, day of the month, month and day of the week, that tells a scheduler when to run a job. A star means every value, and lists, ranges and steps pick some of them.
What does a crontab line look like?
The five schedule fields, then the command: 30 2 * * * /usr/local/bin/backup.sh runs the script at 02:30 every day. Add it with crontab -e, and see the cron syntax cheat sheet for every field and shortcut.
Which time zone does a cron expression use?
The scheduler decides. Linux cron uses the system time zone, Vercel runs in UTC, GitHub Actions uses UTC unless the workflow sets a zone, and Kubernetes uses the controller zone unless the CronJob sets spec.timeZone.
Can cron run a job every 30 seconds?
Not with one line: the smallest unit in Unix cron is a minute. Two lines, one of them starting with sleep 30, run a job every 30 seconds; the every 30 seconds page shows how.

The schedule is the easy part

Knowing that every run happened is the hard part. Each job pings CronMissed when it runs, and you hear about the first one that does not.