Linode Forum
https://forum.linode.com/

cron no longer sending emails
https://forum.linode.com/viewtopic.php?f=11&t=7891
Page 1 of 1

Author:  anshuman100 [ Sat Oct 08, 2011 3:04 pm ]
Post subject:  cron no longer sending emails

Dear members,


I have a quick question - cron used to send emails when any cron tasks/script was executed but just noticed that since a few days emails are not coming when cron runs. I can still send mailx emails from shell scripts though. But cron run per se isnt sending mails anymore. The mails used to come from "Cron Daemon root@<my_linode>.members.linode.com".

Any pointers please?

Thanks and regards,
Anshuman

Author:  Piki [ Sat Oct 08, 2011 3:42 pm ]
Post subject: 

Did you change the entries in your crontab just before the emails stop coming through? How about your mail server settings?

Author:  anshuman100 [ Sat Oct 08, 2011 3:59 pm ]
Post subject: 

I dont remember changing, but I noticed its been not sending emails since mid Sept, so not sure if I did do any upgrades.

I have some scripts which use mailx, if I run them manually they do send the email. So the mail system must be okay. However the emails which use to auto generate on cron runs have stopped. MAILTO variable is set properly too.

cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=admin@mydomain.com
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

Any pointers will be much appreciated.

Author:  Piki [ Sat Oct 08, 2011 4:19 pm ]
Post subject: 

Updates can occassionally break things. Some package managers will replace existing configuration files with a default one, and will rename the original configuration before hand. Sometimes it's even a mistake in the code that was missed when they release.

Make sure everything is up-to-date, then search through the config files for your mail server to make sure it didn't rename/replace your config files. If you know the name of the config files you need to look at, the following command can speed things up:
Code:
updatedb && locate something.conf | grep etc

You'll need either mlocate or slocate installed to do that, though most systems have one of those installed by default.

Replace something.conf with the name of the config file. The "| grep" ([pipe character] grep) part will act as a filter for locate, and will only let the results show that have etc in them, which is useful for config files since most of them are in /etc.

Only look at the stuff for your mail server and cron. It's unlikely anything else will have broken cron's ability to send emails.

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/