Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

when cron jobs finished, mails sent to the user

Status
Not open for further replies.

wchuacs

MIS
Oct 12, 2000
21
US
Hi all,

I set some cron jobs and when those jobs done, mails always sending to the user. When I login using the user, the message "You have new mail." appears... Is there any setting leads to this kind of feature turned on ?
How to turn it off ?
the mails stored in /var/spool/mail

I am using Compaq Tru64 Digital Unix v4.0F.

thank you thanks & regards,
CS
 
hi,
you have to change your cron job, so that it will not produce any terminal output. Redirect stdout and stderr to a file or to /dev/null.
regards
 
You can avoid this by redirecting the output of the job in your crontab. Use * * * * * /path/to/job >> /dev/null
and you will only get mailed the error messages; to ignore those as well, use
* * * * * /path/to/job >> /dev/null 2>&1
Hope this works for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top