Stop systemd timers from running in the past when your server reboots

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

Stop systemd timers from running in the past when your server reboots

🧩 The Challenge

You finally move your messy cron jobs over to systemd timers, only to have them all trigger the second the server comes back up from a reboot. It’s infuriating when a maintenance task you scheduled for 3 AM runs at noon just because you had to restart for a kernel patch.

💡 The Fix

Add a specific setting to your timer unit to force it to ignore missed runs. It keeps your schedule clean and prevents that accidental stampede of jobs on boot.

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

⚙️ Why It Works

Setting Persistent to false tells systemd to skip the execution if the time window was missed while the system was down. The default is actually true for most distros, which is exactly why your jobs fire off unexpectedly after a reboot.

🚀 Pro-Tip: Use systemd-analyze calendar to check your syntax before you reload the daemon.

Linux Tips & Tricks | © ngelinux.com | 8/16/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted