The Delayed Task Runner
Linux systems use cron jobs to execute automated tasks at specific times. However, standard cron requires the system to be powered on exactly when the task is scheduled. To solve this for laptops and desktops that are frequently turned off, Ubuntu uses anacron. This daemon checks if daily, weekly, or monthly maintenance tasks (like log rotation or apt updates) were missed while the machine was asleep, and immediately executes them shortly after the system boots.
While useful for personal laptops, anacron is entirely redundant and sometimes problematic on a dedicated server that runs 24/7. On a high-performance server, you want exact, predictable control over when maintenance scripts run using standard cron or systemd timers. Having anacron suddenly decide to run a heavy log compression job five minutes after an unexpected reboot can severely impact your server’s startup performance. On always-on systems, it is best practice to disable it.
How to Disable the Anacron Service
You can stop this delayed job runner using systemctl.
Warning: Only do this on a server that runs continuously. Disabling this on a laptop means essential system maintenance tasks will likely never run.
- Open your Ubuntu Terminal or connect via SSH.
- Stop the currently active service (if it is running):
sudo systemctl stop anacron.service
- Disable the service so it does not initialize on the next system boot:
sudo systemctl disable anacron.service
- Additionally, mask the service. This prevents other services or update scripts from accidentally re-enabling it:
sudo systemctl mask anacron.service
Your server will now rely strictly on its precise, scheduled cron jobs, preventing unpredictable spikes in CPU and disk I/O shortly after booting.