Interview Prep/Linux/Processes, Signals & systemd

What are systemd timers and how do they compare to cron?

IntermediateConceptProcesses, Signals & systemd
Answer

A .timer unit triggers a matching .service unit.

# backup.timer
[Timer]
OnCalendar=*-*-* 02:30:00
Persistent=true
RandomizedDelaySec=10m
[Install]
WantedBy=timers.target

Advantages over cron: logs in journald, dependencies, resource limits, Persistent=true runs missed jobs after downtime, and no overlapping runs of the same service. systemctl list-timers shows next and last run. Validate expressions with systemd-analyze calendar "Mon *-*-* 09:00".

All Linux questions Roadmap: Linux

More on Processes, Signals & systemd