What is a Cron Expression?
A Cron expression is a string composed of five fields separated by white space that represents a schedule for executing task commands in Unix/Linux automated job schedulers (crontab).
Crontab Field Syntax
| Field | Allowed Values | Special Characters |
|---|---|---|
| Minute | 0 - 59 | * , - / |
| Hour | 0 - 23 | * , - / |
| Day of Month | 1 - 31 | * , - / |
| Month | 1 - 12 (or JAN-DEC) | * , - / |
| Day of Week | 0 - 6 (0 is Sunday, or SUN-SAT) | * , - / |
Special Character Meanings
*(Any Value): Specifies that the event will occur for every unit of time.,(Value List Divider): Specifies a list of values (e.g.,1,3,5in hour field means 1AM, 3AM, and 5AM).-(Range): Defines a range of values (e.g.,1-5in day of week means Monday through Friday)./(Step Values): Specifies incremental steps (e.g.,*/15in minute field means every 15 minutes).