How-to, notes, thoughts

Search

Search loads after the Pagefind index is built into public/pagefind.


Systemd Timers Need Persistent For Missed Runs

A systemd timer only fires while the machine is awake unless it is told how to handle missed runs. That default is fine for always-on servers, but it surprises on laptops, small home boxes, and VMs that may be stopped overnight.

Persistent=true changes the behavior for calendar timers. If a scheduled run was missed while the system was down, systemd starts the service once after boot. It does not replay every missed interval; it catches up with one run, which is usually the safer contract for backups, sync jobs, reports, and housekeeping tasks.

[Timer]
OnCalendar=daily
Persistent=true

The setting belongs in the .timer unit, not the .service. It also only matters for timers based on real time, such as OnCalendar=. Monotonic timers like OnBootSec= or OnUnitActiveSec= already count from system events and do not have a wall-clock schedule to catch up.

For cron-like work, this small flag is the difference between “runs every night” and “runs the next time the box exists.” On machines that sleep, that distinction is not academic.