Linux Labs

Packages, services, and logs / Stage 11 of 13

Cron jobs and systemd timers

Not running Starting usually ~20 s
Leave the lesson

Step 8 of 8 · summary · 2 min

Summary

  • Schedules live in personal cron tables, in /etc/crontab and /etc/cron.d, and also in systemd timers.
  • A cron line is five time fields and a command; in the system files a user name sits between them.
  • cron throws away job output, so a run is checked with sudo journalctl -u cron, and % in a command is written as \%.
  • A timer sets the moment, a service does the work; enable --now turns a timer on right away and after a reboot.
  • At the start of the lesson crontab -l printed "no crontab for student": it shows only the personal table, while the machine's schedules were in /etc/crontab and in the systemd timers.
Ubuntu 24.04
Loading…