Cron syntax in 60 seconds
A crontab line has five schedule fields followed by the command: minute hour day-of-month month day-of-week. Each field accepts a number, a name where applicable (JAN, MON), a range (1-5), a list (1,15), a step (*/10), or * for every value. Two traps catch nearly everyone:
- Day-of-month OR day-of-week. When both are restricted, classic cron runs the job when either matches, not both.
- Server timezone. Cron fires in the timezone of the machine, which on most servers is UTC, not your local time.
Once the schedule is right, the remaining risk is silent failure: cron will not tell you when the job stops running. That is what cron job monitoring is for: the job pings a URL on every successful run, and you get alerted when the pings stop.