Stop cron from sending you junk mail every single minute
Cron & Task Scheduling (Cron/Systemd Timers/At)
Stop cron from sending you junk mail every single minute
🧩 The Challenge
Setting up a quick cron job is great until you realize your mailbox is drowning in local delivery reports for every single execution. Nobody wants their root or user inbox clogged with thousands of lines of output just because a script finished its job successfully.
💡 The Fix
Redirect the output of your crontab entry directly to the null device or a dedicated log file if you actually care about debugging later. It keeps your system mail clean and stops the annoying alerts from piling up.
* * * * * /usr/local/bin/backup_script.sh > /dev/null 2>&1
⚙️ Why It Works
By slamming both stdout and stderr into /dev/null, you effectively tell cron to stay quiet unless something catastrophic happens. If you need to troubleshoot, just point that output to a file in /var/log/ instead.
🚀 Pro-Tip: Use logger -t my_script_name to send status updates to syslog instead of raw files.
Linux Tips & Tricks | © ngelinux.com | 12/5/2026
