Blog
systemd timer not running? Causes and checks
A systemd timer that does not run is usually not enabled, has an OnCalendar= line systemd rejected or reads differently, was edited without a daemon-reload, missed its time while the machine was off, or is waiting for a previous run that never ended. A few systemd commands tell you which. Here is how to read them, fix each cause, and notice the next time a timer goes quiet.
Why is my systemd timer not running?
Section titled “Why is my systemd timer not running?”A timer does no work itself: when it elapses, it starts a service, by default the one with the same name (backup.timer starts backup.service). So there are two units to look at. Start with the list of timers systemd has loaded:
systemctl list-timers --allEach line shows NEXT (when it will run), LEFT, LAST (when it last ran), PASSED, the UNIT and the service it ACTIVATES. A timer missing from the list, or with no NEXT, is the answer: systemd will not start it. For a user timer, run systemctl --user list-timers --all: the plain command lists only the system’s timers. A timer with a NEXT in the future and a recent LAST did run: look at the service instead (cause 6).
1. The timer is not enabled or not started
Section titled “1. The timer is not enabled or not started”Enabling the service does nothing for the schedule; the timer is what must be enabled and started. And systemctl enable alone does not start it until the next boot: the systemctl manual notes that enabling “does not have the effect of also starting any of the units being enabled”, and points to --now for that. The timer also needs an [Install] section, or enable has nothing to hook it to:
[Timer]OnCalendar=*-*-* 02:00:00Persistent=true
[Install]WantedBy=timers.targetsystemctl enable --now backup.timerTo confirm, systemctl status backup.timer shows inactive (dead) for a timer that is not started, and disabled for one that will not come back after a reboot.
2. The calendar is not what you wrote
Section titled “2. The calendar is not what you wrote”OnCalendar= is not cron syntax. A line copied from a crontab is rejected, and the timer with it:
$ systemd-analyze verify ./backup.timerbackup.timer:2: Failed to parse calendar specification, ignoring: 0 2 * * *backup.timer: Timer unit lacks value setting. Refusing.A misspelled setting is worse, because the timer still loads and the setting is simply dropped: Persistant=true gives Unknown key name 'Persistant' in section 'Timer', ignoring.
A valid expression can still mean something other than you meant. Test it before you rely on it; the documentation says systemd-analyze calendar is there “to validate and normalize calendar time specifications”, and it also prints the next run:
$ systemd-analyze calendar "*-02-30 00:00"Normalized form: *-02-30 00:00:00 Next elapse: neverWatch the time zone too. Calendar times are in the machine’s time zone unless the expression names one, and many servers and containers run in UTC: a timer meant for 02:00 in Paris runs at 02:00 UTC there. Check with timedatectl, or write the zone into the expression: OnCalendar=*-*-* 02:00 Europe/Paris.
3. The change was never loaded
Section titled “3. The change was never loaded”systemd reads unit files when it loads them, not every time they change on disk. After editing a timer, the old schedule stays in force until you reload, and systemctl status warns that the unit file changed on disk. The systemd.unit manual’s instruction is to “use systemctl daemon-reload”:
systemctl daemon-reloadsystemctl restart backup.timerTo confirm, compare the NEXT column of list-timers with the schedule in the file.
4. The machine was off at the scheduled time
Section titled “4. The machine was off at the scheduled time”A timer on OnCalendar= that should have fired while the machine was off, or while the timer was stopped, does not catch up by default. Persistent=true changes that: systemd stores when the service last ran, and on the next start runs it at once if a run was missed. The manual notes that this “only has an effect on timers configured with OnCalendar=”. A machine that was asleep is different: the timer fires once when it wakes up.
To confirm, look at LAST: a date older than the schedule allows, on a machine that was rebooted or stopped around that time.
5. The previous run never ended
Section titled “5. The previous run never ended”When a timer elapses while its service is still running, systemd does not start a second run: “it is not restarted, but simply left running.” A job that hangs, on a network call with no timeout, for example, therefore stops every later run. And a Type=oneshot service, the usual kind behind a timer, has no start timeout by default: TimeoutStartSec= “is disabled by default” for it, and RuntimeMaxSec= “does not have any effect” on it.
To confirm, systemctl status backup.service shows activating (start) long after the job should have finished. Give the job a limit, so a stuck run fails instead of blocking the next ones:
[Service]Type=oneshotExecStart=/usr/local/bin/backup.shTimeoutStartSec=30min6. The timer runs, the service fails
Section titled “6. The timer runs, the service fails”Sometimes the timer did its part and the job did not. LAST is recent, but nothing was produced:
systemctl status backup.service # Active: failed (Result: exit-code)journalctl -u backup.service -n 50 # the script's own output and errorsThe usual reasons are those of any scheduled job: a PATH or environment that is not your shell’s, a missing permission, a network that is not up yet.
7. Two less common cases
Section titled “7. Two less common cases”- A user timer (
systemctl --user) runs inside that user’s service manager, which by default exists only while the user is logged in.loginctl enable-linger <user>keeps it: “a user manager is spawned for the user at boot and kept around after logouts.” OnUnitActiveSec=alone. It counts from when the service was last activated, and after a boot there is no such moment yet. The documentation’s example of a regular interval pairs it withOnBootSec=: one gives the first run, the other every run after it.
Why nothing tells you
Section titled “Why nothing tells you”None of these causes raises an alarm. A timer that is not enabled, a calendar that was rejected at load, a missed run, a hung service: all of them produce no failure, because nothing ran. systemd’s own OnFailure= only helps with cause 6: it starts a unit when the service “enters the ‘failed’ state”, and a run that never happens never gets there.
The signal that covers every case is the missing run. Have the job report each successful run to a service that knows the schedule and alerts when a report does not arrive, a dead man’s switch. With SilenceWatch, that is one curl in the service, sent only if the script succeeded. Create the check with the same schedule as the timer, here cron 0 2 * * * in the time zone the timer runs in, and a grace period longer than the job (see schedules and states):
[Service]Type=oneshotExecStart=/bin/sh -c '/usr/local/bin/backup.sh && curl -fsS -m 10 --retry 3 https://app.silencewatch.com/p/<ping-key>'TimeoutStartSec=30minThen a disabled timer, a rejected calendar, a missed run, a stuck or failing service all end the same way: no ping, and an alert once the grace period has passed. The examples cover crontab, Docker and Kubernetes the same way.
Frequently asked questions
Section titled “Frequently asked questions”Why is my systemd timer not triggering?
Most often the timer itself was never enabled and started (systemctl enable --now name.timer), its OnCalendar= line was rejected or means a different time than intended, it was edited without systemctl daemon-reload, or the previous run of its service is still active. systemctl list-timers --all and systemctl status on both units tell you which.
How do I check when a systemd timer will run next?
systemctl list-timers --all shows the next and the last run of every loaded timer. To test an expression before using it, systemd-analyze calendar prints its normalized form and its next occurrence.
Does a systemd timer run missed jobs after a reboot?
Only with Persistent=true, and only for OnCalendar= timers: systemd then runs the service once at startup if a run was missed while the machine was off. A run missed during sleep is caught up when the machine wakes.
Why does my systemd timer run a little late?
AccuracySec= defaults to one minute: systemd may start the service anywhere in that window to group wake-ups. Set AccuracySec=1s if the exact second matters, and check that no RandomizedDelaySec= adds a delay.
How can I be alerted when a systemd timer stops running?
Have the service report every successful run to a service that expects it on the same schedule and alerts when it is missing, a dead man’s switch. OnFailure= alone only covers runs that start and fail.