Pcornel
Linux

Scheduling

Cheat sheet · https://pcornel.dk/topic.php?topic=2825

Back to the Topic

Answer

Scheduling runs jobs automatically at set times: cron (crontab, /etc/cron.d, /etc/cron.daily …), systemd timers, and at for one-off jobs.

Remember

Scheduled jobs run with a minimal environment (short PATH, no aliases, no terminal) — use full paths and log output. Check whether the scheduler ran the job before debugging the job itself.

First checks

  • systemctl list-timers --all — systemd timers and next run
  • crontab -l -u <user> — a user's cron jobs
  • ls /etc/cron.d /etc/cron.daily — system cron jobs
  • journalctl -u cron -u crond --since today — cron executions

Commands

crontab
List, install, edit or remove per-user cron schedules.
at
Queue commands for one-time execution by the at daemon at a specified time.
systemctl list-timers

Verify in this order

schedule defined → scheduler triggers at the time → job runs as the user with a minimal environment → exit status and output logged

Where it usually breaks

First mismatch in persistent unit/config/generator → dependency/order graph → systemd state → process/cgroup → socket/resource dependency → journal → consumer check; preserve identity/native diagnostic/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2825

Confirmation

Confirm action

Continue?