1753970 Members
7620 Online
108811 Solutions
New Discussion юеВ

Re: crontab question

 
SOLVED
Go to solution
Patrice Blanchard_2
Frequent Advisor

crontab question

Hi,

i have a job in the crontab that is running every 5 minutes. The problem is that it sending an email to root everytime. Is there a way to deactivate it? I want to keep having an email send to root for my backups but not for this job.

thanks

regards
5 REPLIES 5
Alexander Chuzhoy
Honored Contributor
Solution

Re: crontab question

edit /etc/crontab and delete the line MAILTO=root
then add this line to a specific cront job
Huc_1
Honored Contributor

Re: crontab question

run the following command as root to look at the content of root contab

#crontab -l

To modify the crontab entry so it stop sending mail each time it runs, that is if this is part of the contab entry.

# crontab -e

If the mail is send from the within the script, modify the script.

If this does not help attach you crontab and or the content of the invoked script, so whe can help you futher.

J-P




Smile I will feel the difference
Patrice Blanchard_2
Frequent Advisor

Re: crontab question

actually, i'm doing a mailx in the script if the process i'm checking every 5 minutes is not running. But i do have another process (running every 30 minutes) that does not have a mailx in it but sends an email to root when it ran.
Balaji N
Honored Contributor

Re: crontab question


what does the mail contain. how about redirecting the standard error and output to a different file.

-balaji
Its Always Important To Know, What People Think Of You. Then, Of Course, You Surprise Them By Giving More.
V.Tamilvanan
Honored Contributor

Re: crontab question

Hi,
00 08 * * * /scripts/fs_check3.sh >/dev/null 2>&1

This is a crontab entry which runs everyday at 8am and I redirected whatever the output and the error to null. Inside the script I have a mailx command which sends me mail whenever the failure occurs.

Do a
# crontab -e
Edit your script line and add the entry >/dev/null 2>&1 at the end of the line.
You mar redirect to a temp file also for your future reference.