Cron & Task Scheduling (Cron/Systemd Timers/At)
Stop cron jobs from mailing you to death
đź§© The Challenge
You finally got that backup script working, but now your root mailbox is flooded with empty delivery reports every single time it runs. I’ve wasted an entire afternoon cleaning out thousands of these useless system messages before.
đź’ˇ The Fix
Redirect the output of your job directly to null so your logs stay clean and your mail queue doesn’t choke. It keeps the noise down while still letting errors show up if you configure it right.
* * * * * /usr/local/bin/backup.sh > /dev/null 2>&1
⚙️ Why It Works
Adding the redirect sends both standard output and standard error into the black hole of dev null, meaning nothing gets buffered for the mail daemon to pick up. When you don’t define a destination, cron tries to be helpful by piping output to the local mail user, which is rarely what you want for a routine job.
🚀 Pro-Tip: If you only want to ignore the successful runs but still get notified on errors, use a wrapper script or log your output to a dedicated file instead.
Linux Tips & Tricks | © ngelinux.com | 11/4/2026
