Cron & Task Scheduling (Cron/Systemd Timers/At)
Stop cron from sending you empty emails every time a script runs
🧩 The Challenge
Setting up a quick cron job feels great until your inbox gets hammered by useless notifications for every single script execution. I’ve spent way too much time clearing out hundreds of “Subject: Cron <root@host> …” emails that contain absolutely nothing of value.
💡 The Fix
Just redirect both standard output and standard error to dev null in the crontab line itself. This keeps your logs clean and saves your email inbox from a slow, painful death.
* * * * * /usr/local/bin/backup.sh > /dev/null 2>&1
⚙️ Why It Works
Adding the redirect tells the shell to throw the command output and errors into the void rather than piping them to the local mail transfer agent. You won’t get an email unless the cron daemon itself fails to execute your command.
🚀 Pro-Tip: If you actually need logs for troubleshooting, point that output to a specific file in /var/log/ instead of trashing it.
Linux Tips & Tricks | © ngelinux.com | 8/16/2026
