Systemd Timers and Targets: Beyond Basic Service Management
Timers replace cron with better logging and dependency awareness, and targets group units into coordinated stacks. Here is how I use both. Systemd does more than start and stop services. It also manages timers, which replace cron for many use cases, and targets, which group units into dependency relationships. After relying on systemd for years across production servers, I now use timers for anything that needs precise scheduling, logging, or dependency awareness, and targets to organize how services boot together. Here is what I use. Why Timers Over Cron Cron is simple and reliable, but it has blind spots. It does not know if a job is already running, it has no built-in logging, and its environment is minimal. Systemd timers solve all three. A timer unit triggers a service unit on a schedule, and because the service runs under systemd, its output goes to the journal, failures are visible with systemctl status , and you can express dependencies on other units. Creating a Timer A timer requires two files: a service unit that does the work, and a timer unit that schedules it. The service is a normal systemd service with…