HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
cancel
Showing results for 
Search instead for 
Did you mean: 

Cron is sending mail.

 
vinu1
Occasional Visitor

Cron is sending mail.

My sendmail service is stopped and cron sends mail, those mail get queued up in clientmqueue directory. I want to stop cron from sending mails. All jobs run under root. And cron sends mail to root. I have tried to set MAILTO="", but its not working. Is there any other way to stop mails from cron to root? Thanks in advance.
7 REPLIES
Johnson Punniyalingam
Honored Contributor

Re: Cron is sending mail.

can you check from root crontab "any entry" for sendmail ?

you can comment that line.

HTH,

Regards,
Johnson
Problems are common to all, but attitude makes the difference
vinu1
Occasional Visitor

Re: Cron is sending mail.

Hi, I have checked there is no entry in crontab file regarding sendmail. There are variabels like path, shell, mailto etc. and scheduled jobs like cron.dailly, cron.weekly etc.

Vinu
Aneesh Mohan
Honored Contributor

Re: Cron is sending mail.

vinu1
Occasional Visitor

Re: Cron is sending mail.

Hi Aneesh,
I have tried that, but its not working,
and my /etc/crontab looks as :

MAILTO=""
01 * * * * root run-parts /etc/cron.hourly >> /var/log/cron 1 <&2
etc.

And I dont want mails from cron. What should i do?

Thanks
Vinu

Aneesh Mohan
Honored Contributor

Re: Cron is sending mail.

Hi,

can you change the entry in crontab like below and let me know

01 * * * * root run-parts /etc/cron.hourly >> /var/log/cron 2>&1


Aneesh
Tingli
Esteemed Contributor

Re: Cron is sending mail.

Try
01 * * * * root run-parts /etc/cron.hourly > /dev/null 2>>&1

Re: Cron is sending mail.

>Is there any other way to stop mails from cron to root?

By redirecting stdout and stderr in root's crontab, for each entry, either to a file or /dev/null.
Or for each script, do it inside.

>MAILTO=""

This doesn't exist for HP-UX.

>Aneesh: Please see the below thread.

That's Linux only.