Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - Tru64 Unix
cancel
Showing results for 
Search instead for 
Did you mean: 

How to supress mail from crontab jobs to root

SOLVED
Go to solution
sap-basis
Occasional Advisor

How to supress mail from crontab jobs to root

Hi, All:

I wrote some Perl programs and scheduled those perl programs to be run in crontab with ID root.
Those perl jobs themselfs are running fine but every time after a job finishes, the system will send mail to id root(which is the owner of the crontab) about it. Some of the perl jobs are running every hour or even every half hour. This could be annoying because I have clean the mailbox of root very often.

Does anybody know when I schedule those Perl programs in Crontab, how can I supress the mail to ID root? I just want to disable the mail received from the execution of those Perl programs but not disable root from receiving mail from other crontab jobs(other jobs are not executed as often as the Perl ones so it does not matter much).
Thanks.
6 REPLIES
Victor Semaska_3
Esteemed Contributor
Solution

Re: How to supress mail from crontab jobs to root

Look at this thread to see if it helps you.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=901569

Vic
There are 10 kinds of people, one that understands binary and one that doesn't.
sap-basis
Occasional Advisor

Re: How to supress mail from crontab jobs to root

yeah, you are right!

Problem solved!

Thanks a lot!
Ross Minkov
Esteemed Contributor

Re: How to supress mail from crontab jobs to root

Just add "> /dev/null" or "> /dev/null 2>&1" at the end of the crontab line with your script. Make sure you understand the difference between the two. I'd suggest add just ""> /dev/null" first.

-Ross
sap-basis
Occasional Advisor

Re: How to supress mail from crontab jobs to root

Hi, Ross:

Thanks for the reply.

Your solution is right, thanks!
Ross Minkov
Esteemed Contributor

Re: How to supress mail from crontab jobs to root

Seeing that you are new to the HP ITRC forums... please read about our points system here http://forums1.itrc.hp.com/service/forums/helptips.do?#28

Best Regards,
Ross
sap-basis
Occasional Advisor

Re: How to supress mail from crontab jobs to root

Thanks, points assigned to both of you.

Have a good one!