How to silence a CRON and prevent it to send emails

Problem:
Every time that a CRON is running, an email is sent.  Those emails aren't always welcome.

Solution:
Simply append the following string to your command:
 > /dev/null 2>&1

i.e.
/usr/local/sbin/mycommand.sh > /dev/null 2>&1


Feel free to open a ticked if you want us to make it happen for you.
  • 1 کاربر این را مفید یافتند
آیا این پاسخ به شما کمک کرد؟

مقالات مربوطه

Installing IPSet on CentOS

CSF (ConfigServer Firewall) on a Linux system and you block a lot of IP addresses, performance...

crontab management

crontab is a command line tool in order to manage your cron tasksThe two most important basic...

Test CRON

You may want to test if the CRON is running on your server.  There is few ways in order to test...

[EA3] New Relic APM on cPanel & CloudLinux CageFS

Many System Administrators tried to get PHP apps hosted on a cPanel server with CloudLinux and...

[CentOS/RHEL/CloudLinux] rpc.statd is not running but is required for remote locking

Fixing rpc.statd is not running but is required for remote locking   If you come across this...