Developer · 3 min read ·
Cron expressions explained, with 10 ready-to-use examples
Five fields, four symbols and one time-zone trap. Learn to read and write cron schedules, with examples you can copy.

Cron is the scheduler behind backups, reports and clean-up jobs on servers everywhere, and its syntax also appears in GitHub Actions, Kubernetes CronJobs and most cloud schedulers. A schedule is five fields separated by spaces.
┌ minute (0-59)
│ ┌ hour (0-23)
│ │ ┌ day of month (1-31)
│ │ │ ┌ month (1-12)
│ │ │ │ ┌ day of week (0-6, 0 = Sunday)
* * * * *
Four symbols
* means every value. A comma makes a list (1,15), a dash makes a range (1-5) and a slash makes a step (*/15 = every 15 units). Those four cover almost every schedule.
10 examples
*/5 * * * * every 5 minutes
0 * * * * every hour, on the hour
0 9 * * * every day at 09:00
30 2 * * * every night at 02:30
0 9 * * 1-5 weekdays at 09:00
0 18 * * 5 Fridays at 18:00
0 0 1 * * midnight on the 1st of every month
0 0 1 1 * once a year, on 1 January
0 */6 * * * every 6 hours
15 8,12,17 * * * 08:15, 12:15 and 17:15 every day
Trap 1: day of month and day of week
When both fields are restricted, classic cron runs the job when either one matches. 0 0 1 * 1 runs on the 1st of the month and also on every Monday, not only on Mondays that fall on the 1st.
Trap 2: the time zone
Cron has no time zone of its own. The job runs in the time zone of the machine or service that runs it, which is often UTC. A job set to 0 9 * * * on a UTC server runs at 09:00 UTC, which may be hours earlier or later where you are, and daylight saving time can shift it again.
Trap 3: overlapping and missed runs
Cron starts a job on schedule whether or not the previous run has finished. A backup set to run every 5 minutes that takes 7 minutes ends up running twice at once. Wrap long jobs in a lock (on Linux, flock does this in one line) or make them safe to run in parallel. Cron also doesn’t catch up: if the machine is off at 02:30, the 02:30 job simply doesn’t run that night.
*/5 * * * * flock -n /tmp/backup.lock /usr/local/bin/backup.sh
Shortcuts and small differences
Many cron implementations accept shortcuts such as @hourly, @daily, @weekly, @monthly and @reboot instead of five fields. In most of them Sunday can be written as 0 or 7, and names such as MON or JAN are allowed. Platforms differ in the details, so check the documentation of the system that will run the job, especially for managed cloud schedulers.
Where does the output go?
By default cron mails a job’s output to the local user, which on most servers means it disappears. Redirect output to a log file, or to your logging system, so a failing job leaves a trace:
30 2 * * * /usr/local/bin/report.sh >> /var/log/report.log 2>&1
Check before you deploy
Paste an expression into the 4Dev Cron Expression Explainer and it reads the schedule back in plain language. It handles the standard five-field format; six- or seven-field expressions with seconds or years, as used by Quartz or Spring, are rejected with an error.