Iron Ladder

Moving my cron jobs to systemd timers

2026-06-03 · systemd, linux

I resisted this for years because crontab is one line and a timer is two files. What changed my mind was a backup job that had been failing silently for eleven days, with its output mailed to a local mailbox nobody read.

A timer and its service

# /etc/systemd/system/backup.service
[Unit]
Description=Nightly restic backup

[Service]
Type=oneshot
ExecStart=/usr/local/bin/backup.sh

# /etc/systemd/system/backup.timer
[Unit]
Description=Run backup nightly

[Timer]
OnCalendar=*-*-* 03:15
RandomizedDelaySec=20m
Persistent=true

[Install]
WantedBy=timers.target

Enable with systemctl enable --now backup.timer.

What I gained

What I miss

Seeing every scheduled job on one screen. systemctl list-timers comes close, and I have stopped missing it much.