The crontab syntax consists of five fields followed by the command to be executed. The fields represent time and date when the command should run. The syntax is as follows:
* * * * * command_to_execute
Each asterisk can be replaced with specific values:
- Minute (0-59)
- Hour (0-23)
- Day of the Month (1-31)
- Month (1-12)
- Day of the Week (0-7) (Sunday is both 0 and 7)
You can use the following symbols in the fields:
*- Every value (e.g., every minute, every hour),- List of values (e.g.,1,2,3for the 1st, 2nd, and 3rd)-- Range of values (e.g.,1-5for Monday to Friday)/- Step values (e.g.,*/5for every 5 minutes)
For example, the cron schedule 0 9 * * 1-5 means "run the command at 9 AM on weekdays (Monday to Friday)."
