Symptoms
You have set the email address for cronjobs to send notifications to, but the cronjob is not sending the email.
Description
If the email address is set for a cronjob, it will only send a notification if the script or binary that is being executed produces some sort of output. There are a few things to check to ensure that the cron emails are working as expected:
- Verify the cron job is running in the cron logs. The following article can assist with this:
How to verify if a cronjob was run - Verify that the "mailto" variable is set properly, and the output is not being redirected to /dev/null. This will prevent a cron job from producing any output:
How to silence a cron / cronjob so that it does not send notifications - Verify that the "CRONDARGS" variable has not disabled email output. You can check the crond configuration file for the variable to see how it has been set:
[root@10-2-33-202 ~]# grep "CRONDARGS" /etc/sysconfig/crond
By default these flags are empty. If you find that the "-m off" flag is present, remove this from the configuration and restart crond to continue sending messages.
# CRONDARGS= : any extra command-line startup arguments for crond
CRONDARGS="-s -m off" - Execute the cron job manually to ensure it generates output. Please note this must be done a certain way to ensure the safety of your server. Please review the following article for the instructions on executing a cron safely on the command line:
How to troubleshoot user-level cronjob issues - Check the Exim logs to see if the email is leaving the server. You can use exigrep to search for the email address configured in your crontab:
exigrep emailaddress@example.com /var/log/exim_mainlog
Comments
0 comments
Article is closed for comments.