Stop your systemd timers from running in the past

Cron & Task Scheduling (Cron/Systemd Timers/At)

Stop your systemd timers from running in the past

🧩 The Challenge

Everyone thinks systemd timers are just like cron, until you reboot a server and it decides to run a massive data cleanup job the second the system comes back up. It’s annoying to have your disk I/O get hammered while you’re still trying to SSH in and check if the kernel even booted correctly.

💡 The Fix

Adding a simple directive to your timer file tells systemd to chill out and ignore missed runs from when the machine was powered off. You want your maintenance tasks to be predictable, not reactive to a reboot.

[Timer]
OnCalendar=daily
Persistent=false
[Install]
WantedBy=timers.target

⚙️ Why It Works

By flipping Persistent to false, you force the unit to strictly adhere to its schedule rather than checking the last run time upon startup. This effectively turns off the behavior where systemd tries to play catch-up for all the time the server spent in a dark state.

🚀 Pro-Tip: Always run systemctl daemon-reload after you touch these files or systemd will just keep ignoring your changes.

Linux Tips & Tricks | © ngelinux.com | 9/26/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted