Cron syntax
┌──── minute (0–59) │ ┌──── hour (0–23) │ │ ┌──── day of month (1–31) │ │ │ ┌──── month (1–12) │ │ │ │ ┌──── day of week (0–7, Sunday = 0 or 7) * * * * *
- * — every value
- 1,15 — a list
- 9-17 — a range
- */10 or 0-30/10 — a step
Shortcuts: @hourly, @daily, @weekly, @monthly, @yearly.
Common pitfalls
Jobs run with a minimal environment — use full paths to commands and files. Redirect output somewhere (>> /var/log/job.log 2>&1) so failures aren’t silent. And remember a job at 2:30 may run twice or not at all on daylight saving changeover nights.