What is a Cron Expression?
A cron expression is a compact string format used by Unix, Linux, and modern job schedulers to define automated execution intervals. In standard Unix crontab specifications, an expression consists of exactly five space-separated fields representing Minute (0-59), Hour (0-23), Day of Month (1-31), Month (1-12), and Day of Week (0-6, where 0 is Sunday). When a schedule daemon evaluates the expression, it determines whether the current system timestamp satisfies all active field constraints.
The Standard 5-Field Format
Standard crontab follows a strict 5-column positional order:
* * * * * ┬ ┬ ┬ ┬ ┬ │ │ │ │ └─ Day of Week (0 - 6, 0 = Sun) │ │ │ └─── Month (1 - 12) │ │ └───── Day of Month (1 - 31) │ └─────── Hour (0 - 23) └───────── Minute (0 - 59)
Day of Month vs Day of Week Semantics
A critical distinction in standard POSIX crontab is the handling of day constraints. When both Day of Month and Day of Week are explicitly restricted (neither is an asterisk *), standard cron evaluates the condition as a logical OR union rather than an AND intersection. The job fires if either the calendar day matches OR the day of the week matches.
Related Developer Utilities
- Unix Timestamp & Epoch Converter - Convert epoch milliseconds, seconds, and ISO 8601
- Free Online JSON Formatter & Beautifier - Format and validate structured JSON data
- Regex Tester & Explainer - Test and debug regular expressions with capture groups
- Docker Compose Validator - Inspect container configurations and environment variables