Use this when writing cron schedule expressions.
Cron · Scheduling
Cron schedules use five fields — minute, hour, day of month, month, day of week — such as 0 3 * * 1-5 for 03:00 on weekdays, and tools like crontab.guru help check expressions.
1. cron syntax: minute hour day month weekday.
2. Use full paths.
3. Redirect output.
4. flock for overlap.
5. CRON_TZ where supported.
cron schedule → command
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Common mistakes Narrow the fault
- Assuming the server's time zone.
- Day-of-month and day-of-week both set (cron ORs them).
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Fields: minute hour day-of-month month day-of-week.
- Use crontab.guru to check expressions.
- cron uses the host's time zone.
crontab -l— entries- flock -n /tmp/job.lock cmd — prevent overlap
journalctl -u cron / grep CRON /var/log/syslog— execution
ReferenceWhy it matters1 section · depth on demand
What it is
cron expressions define when a job runs: minute, hour, day of month, month, day of week. Some schedulers (Quartz, Kubernetes CronJob) use their own variants.
ReferenceImportant terms & boundaries2 sections · depth on demand
How it works
Fields are minute (0–59), hour (0–23), day of month (1–31), month (1–12) and day of week (0–7, Sunday is 0 or 7). * means every, */n every n, a-b a range and a,b a list. Tools like crontab.guru help verify expressions before deployment.
Example
| Expression | Meaning |
|---|---|
*/5 * * * * | Every 5 minutes |
0 2 * * * | 02:00 daily |
0 6 * * 1-5 | 06:00 weekdays |
0 0 1 * * | First of the month |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Scheduling > Cron. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.freedesktop.org/software/systemd/man/latest/systemd.timer.html · confidence 94%