I'm a newbie in server administration (centos 7) and have a problem with email notifications from the cron. There is 1 cron job.
15 * * * * user cd /var/www/domain/public_html/cron && php -d error_reporting="E_ALL & ~E_NOTICE" cron.php
and I set MAILTO in order to be notified about errors. But cron daemon sends me multiple emails every hour or two (also with previous cron errors). Then I wanted to disable email notifications completely so set MAILTO="" but still receiving messages. Probably there is a problem with mail or cron log. Permission denied after trying to clear maillog.
sudo > /var/log/maillog
Any suggestion what to do in order to receive only one email for the cron job?
/etc/anacrontabas you may be running both & that maybe why you get duplicate emails. I can otherwise tell you how to suppress errors from individual cron jobs if you want