Limiting cron mail
Hi
I have a cronjob run by root. This is sending a mail to root which points to x@y.com The cronjob also sends confirmation of the job to x@y.com which I want. Is there a way I can prevent the default cron mail send and just keep below. I dont want to prevent cron mail being received. 0 11 * * * /root/xx.sh | mail -s "`hostname` backup run" x@y.com Can someone assist please. Regards |
Does
Code:
0 11 * * * /root/xx.sh | mail -s "`hostname` backup run" x@y.com > /dev/null 2>&1 |
Hi
I did try that earlier, > /dev/null 2>&1 and that does not do the job. I still receive 2 emails x@y.com and from root that also points to x@y.com The root cron mail has in subject: Cron <root@xxx> /root/x.sh | mail -s "`hostname` Backup" x@y.com and in the body: Null message body; hope that's ok I dont want this... Regards |
You could try
MAILTO="" at the top of your crontab |
Cheers mate that has done the trick 8-)
|
All times are GMT -5. The time now is 04:52 PM. |