Unix cron
Build, validate, and preview standard 5-field Unix cron expressions with timezone-correct next-run previews and copy-ready crontab snippets.
Last verified: 2026-05-15
The five fields
Standard Unix cron is a five-field schedule: minute hour day-of-month month day-of-week. Every field accepts a single value, a range, a list, a step, or the wildcard *. Day-of-week 0 and 7 both mean Sunday. Field order is fixed, whitespace separates fields, and there is no seconds column.
Special strings
GNU cron and most modern crons recognize a small set of aliases that expand to standard five-field expressions:
@yearly/@annually— same as0 0 1 1 *@monthly— same as0 0 1 * *@weekly— same as0 0 * * 0@daily/@midnight— same as0 0 * * *@hourly— same as0 * * * *@reboot— fires once when cron starts (not portable; not supported here)
Step values
Step notation */n means "every n units". */5 in the minute field fires at 00, 05, 10, …, 55. Steps work on ranges too: 9-17/2 in the hour field fires at 09, 11, 13, 15, 17.
The Linux gotchas
- PATH is minimal. The cron daemon runs jobs with a stripped environment. Use absolute paths or set
PATH=at the top of your crontab. - MAILTO="" suppresses email; without it, any output to stdout or stderr is mailed to the user, which fills mail spools fast.
- Use
crontab -erather than editing/etc/crontabdirectly so syntax is validated before saving. - Locking. Long-running jobs can overlap. Wrap with
flock(e.g.flock -n /tmp/my.lock my-command) to prevent re-entry. - Daylight saving. A job scheduled at
02:30 * * *in a DST-aware zone will be skipped on the spring-forward day and run twice on the fall-back day, unless the cron daemon explicitly compensates.
When this dialect is the wrong choice
Unix five-field cron has no ?, no L (last day), no W (nearest weekday), no # (nth weekday of month), no seconds, and no year. If you need any of those, switch to Quartz, AWS EventBridge, or build the logic in application code with a more permissive scheduler.
Found something inaccurate? Email hello@cronpreview.com.