Developer & Data 8 min read • Published 2026-03-24

The Complete Guide to Cron Expressions: Syntax, Scheduling & Real-World Examples

Master UNIX and Quartz cron syntax: minute, hour, day-of-month, month, day-of-week fields, step values, special characters, and production scheduling patterns.

Introduction to Cron and Scheduled Automation

Cron is the standard time-based job scheduler in Unix-like operating systems. Developers and system administrators rely on cron jobs to automate recurring tasks such as database backups, log rotation, cache warmups, email digest dispatching, and system health checks.

The Anatomy of a 5-Field Crontab Expression

A standard UNIX cron expression consists of five fields separated by white space:

┌───────────── Minute (0 - 59)
│ ┌─────────── Hour (0 - 23)
│ │ ┌───────── Day of Month (1 - 31)
│ │ │ ┌─────── Month (1 - 12 or JAN-DEC)
│ │ │ │ ┌───── Day of Week (0 - 6 or SUN-SAT, 0=Sunday)
│ │ │ │ │
* * * * *

Special Characters & Operators Explained

  • Asterisk (*): Wildcard representing "every" possible value in that field. * * * * * executes every single minute.
  • Comma (,): Specifies a list of discrete values. E.g., 0 9,17 * * * fires at 9:00 AM and 5:00 PM.
  • Hyphen (-): Defines an inclusive range. E.g., 0 9 * * 1-5 runs at 9:00 AM Monday through Friday.
  • Slash (/): Specifies step intervals. E.g., */15 * * * * runs every 15 minutes (at minute 0, 15, 30, 45).

10 Real-World Production Cron Patterns

Cron Expression Human Meaning Common Use Case
*/5 * * * *Every 5 minutesAPI health ping / queue monitoring
0 * * * *At minute 0 of every hourHourly aggregate statistics
0 2 * * *Every day at 2:00 AMNightly database backup
0 9 * * 1-5At 9:00 AM Mon through FriWeekday morning standup digest
0 0 1 * *At midnight on day 1 of monthMonthly billing cycle generation

Interactive Testing & Next Execution Timestamps

Before committing automated tasks to your crontab or cloud task runners (AWS EventBridge, Google Cloud Scheduler, GitHub Actions), test your timing syntax with WebUtilities's Cron Expression Builder & Explainer to view the exact human English translation and the next 10 calculated execution timestamps.

Try the Related Tools: