Cron Expressions Explained: A Beginner's Guide
2026-05-30
What is Cron?
Cron is a time-based job scheduler in Unix-like operating systems. It's used to automate repetitive tasks like backups, log rotation, data processing, and system maintenance.
The 5-Field Format
A cron expression has 5 fields:
* * * * *
│ │ │ │ │
│ │ │ │ └── Day of week (0-7, 0=Sunday)
│ │ │ └──── Month (1-12)
│ │ └────── Day of month (1-31)
│ └──────── Hour (0-23)
└────────── Minute (0-59)
Common Patterns
| Expression | Meaning |
|---|---|
| `0 0 * * *` | At midnight every day |
| `0 * * * *` | At the start of every hour |
| `*/5 * * * *` | Every 5 minutes |
| `0 9 * * 1-5` | At 9 AM on weekdays |
| `0 0 1 * *` | At midnight on the 1st of every month |
| `30 4 * * 0` | At 4:30 AM on Sunday |
Special Characters
- **`*`** — Any value (every) - **`/`** — Step values (e.g., `*/5` = every 5 units) - **`-`** — Range (e.g., `1-5` = Mon to Fri) - **`,`** — List (e.g., `1,3,5` = Mon, Wed, Fri)Debug with YZIF
Use the Cron Parser tool on YZIF to instantly translate cron expressions into plain English (or Chinese). Just paste your cron expression and get a human-readable explanation.
Common use cases:
- Verify your cron schedule before deploying
- Understand unfamiliar cron expressions from colleagues' code
- Learn by experimenting with different patterns