UNIX cron expressions are standard for defining recurring automation, database backups, cache purges, and background batch jobs. However, remembering whether field 5 represents day-of-week or day-of-month, or how step operators (*/15) behave on boundary hours, frequently causes misconfigured task schedules.
The Cron Syntax Explainer deconstructs 5-part cron expressions into plain English explanations and calculates projected upcoming execution runtimes in client memory.
1. Anatomy of the 5-Field Cron Format
A standard POSIX cron expression consists of five space-separated fields:
┌───────────── Minute (0 - 59)
│ ┌─────────── Hour (0 - 23)
│ │ ┌───────── Day of Month (1 - 31)
│ │ │ ┌─────── Month (1 - 12 or JAN - DEC)
│ │ │ │ ┌───── Day of Week (0 - 6, Sun = 0 or 7, or SUN - SAT)
│ │ │ │ │
* * * * *
Detailed Field Breakdown:
| Field Index | Target Dimension | Allowed Numeric Values | Allowed Special Characters |
|---|---|---|---|
| Field 1 | Minute | 0 – 59 | * , - / |
| Field 2 | Hour | 0 – 23 (24-hour clock) | * , - / |
| Field 3 | Day of Month | 1 – 31 | * , - / |
| Field 4 | Month | 1 – 12 (or JAN–DEC) | * , - / |
| Field 5 | Day of Week | 0 – 6 (Sunday = 0, or SUN–SAT) | * , - / |
Special Operator Meanings:
*(Wildcard): Represents all possible values in that field ("every minute", "every hour").,(List): Specifies discrete target values (e.g.1,15,30in the minute field).-(Range): Specifies inclusive spans (e.g.1-5in the day-of-week field means Monday through Friday)./(Step Value): Specifies recurring intervals (e.g.*/10in minute field means every 10 minutes).
2. Practical Schedule Recipes & Common Patterns
Here are frequently used production cron expressions for serverless workers and backend crons:
┌─────────────────────────────────────────────────────────────┐
│ Expression Human Schedule Translation │
├─────────────────────────────────────────────────────────────┤
│ */15 * * * * Every 15 minutes │
│ 0 * * * * Every hour on the hour │
│ 0 0 * * * Every day at midnight (00:00 UTC) │
│ 0 9 * * 1-5 Monday through Friday at 09:00 AM │
│ 0 2 1 * * First day of every month at 02:00 AM │
│ 30 23 * * 0 Every Sunday evening at 23:30 PM │
└─────────────────────────────────────────────────────────────┘
Production Examples:
# Database backup every night at 01:00 AM
0 1 * * * /opt/scripts/backup-db.sh
# Purge expired auth sessions every 30 minutes
*/30 * * * * /usr/bin/node /app/clean-sessions.js
# Weekly audit log rollup every Sunday at midnight
0 0 * * 0 /opt/scripts/weekly-report.sh
NOTE: When both "Day of Month" (Field 3) and "Day of Week" (Field 5) are specified with non-wildcard values, standard POSIX cron executes when either condition matches (OR logic, not AND logic).
3. Future Execution Timetable Projection
Beyond human-readable sentence translation, the explainer calculates the next 5 projected execution dates and times based on your local timezone:
Projected Next 5 Executions for [ 0 9 * * 1-5 ]:
1. 2026-11-09 09:00:00 (Monday)
2. 2026-11-10 09:00:00 (Tuesday)
3. 2026-11-11 09:00:00 (Wednesday)
4. 2026-11-12 09:00:00 (Thursday)
5. 2026-11-13 09:00:00 (Friday)
This prevents deployment surprises where an intended hourly schedule accidentally runs every minute.