Automation · Bash Automation
systemd Timers
Cheat sheet · https://pcornel.dk/topic.php?topic=5290
Answer
systemd timers schedule services with .timer units using OnCalendar= or OnBootSec=, with logging in journald, Persistent=true for missed runs and dependencies, as a modern alternative to cron.
Remember
- Pair .timer with .service.
- OnCalendar= for schedules.
- Persistent=true catches missed runs.
First checks
systemctl list-timers --all— timerssystemctl status <name>.timer <name>.service— statejournalctl -u <name>.service— run logs
Commands
systemctl enable --now backup.timersystemctl list-timersjournalctl -u backup.servicesystemctl --failed
Verify in this order
timer → service unit → journal
Where it usually breaks
Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5290