Timer units instead of cron
09 Oct 2026 · linux
Timers give you logs through the journal, dependencies, and the option to catch up after downtime. The pair is short:
# backup.service
[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup.sh
# backup.timer
[Timer]
OnCalendar=*-*-* 03:30:00
Persistent=true
[Install]
WantedBy=timers.target
Persistent=true is the line I missed for years: it runs the job
after a reboot if the scheduled time was skipped.