Back to lessons

Hosting Operations

Spot Stale systemd Timers

A timer may exist but have no next scheduled run, which can hide disabled or stale automation.

Command

systemctl list-timers --all --no-pager --plain | awk 'NR==1 || $1=="n/a" || /backup\.timer|logrotate\.timer/'

What changed

Nothing changes. The command filters the timer list for stale-looking and important automation rows.

Danger

safe

When to use it

Use when backups, reports, renewals, or cleanup jobs stopped running after a migration or package change.

When not to use it

Do not assume n/a is always bad; some timers are intentionally inactive until enabled or triggered.

Undo or recovery

No undo needed because the command is read-only.

Expected output

Timer rows including n/a NEXT values and important scheduled jobs.

demo script

Disposable terminal steps

  1. systemctl list-timers --all --no-pager --plain
  2. systemctl list-timers --all --no-pager --plain | awk 'NR==1 || $1=="n/a" || /backup\.timer|logrotate\.timer/'

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ systemctl list-timers --all --no-pager --plain
NEXT                         LEFT     LAST                         PASSED UNIT                 ACTIVATES
Thu 2026-06-25 22:00:00 CDT  7h left  Thu 2026-06-25 02:00:00 CDT  12h ago backup.timer         backup.service
Fri 2026-06-26 00:05:00 CDT  9h left  Thu 2026-06-25 00:05:00 CDT  14h ago certbot.timer        certbot.service
Thu 2026-06-25 23:50:00 CDT  8h left  Thu 2026-06-25 00:00:10 CDT  14h ago logrotate.timer      logrotate.service
n/a                          n/a      Mon 2026-06-22 01:00:00 CDT  3 days ago stale-report.timer stale-report.service
4 timers listed.
::exit-code::0
$ systemctl list-timers --all --no-pager --plain | awk 'NR==1 || $1=="n/a" || /backup\.timer|logrotate\.timer/'
NEXT                         LEFT     LAST                         PASSED UNIT                 ACTIVATES
Thu 2026-06-25 22:00:00 CDT  7h left  Thu 2026-06-25 02:00:00 CDT  12h ago backup.timer         backup.service
Thu 2026-06-25 23:50:00 CDT  8h left  Thu 2026-06-25 00:00:10 CDT  14h ago logrotate.timer      logrotate.service
n/a                          n/a      Mon 2026-06-22 01:00:00 CDT  3 days ago stale-report.timer stale-report.service
::exit-code::0

YouTube Short

Find stale timers.

If a timer has no next run, it may be disabled, stale, or intentionally parked. Either way, it deserves a look.

LinkedIn hook

The suspicious timer is the one with no next run.

Question: Which timers on your servers would hurt if they silently stopped running?

experiments

A/B tests to run

Metric: short_click_through_rate

A: The suspicious timer has no next run.

B: Find stale automation before it finds you.