Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Supposedly, if you install a cron and the cron job has an output >/dev/null, it will be sent to the system administrator. Is this true? Where does the email get setup? I don't see anything in /etc/mail.rc on this and there is nothing about mail in the crontab either.

Help?

share|improve this question

migrated from stackoverflow.com Aug 20 '11 at 0:53

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 5 down vote accepted

The output will, by default, get sent to whichever user's crontab started the process. If this is the main crontab, then root gets the email.

If you want the mail sent somewhere else, you can either configure your MTA to forward the mail, or set MAILTO from within the crontab to alter the destination. (Use MAILTO="" to suppress mail entirely.)

if you install a cron and the cron job has an output >/dev/null, it will be sent to the system administrator

I believe you meant to say that the job does not have output redirected to /dev/null; if all of the output is written to stdout, and stdout gets sent to /dev/null, then there will be no output to send to anyone.

share|improve this answer
    
Will specifying MAILTO="myemailaddress@someplace.com" within the crontab override sending to the system adminstrator? If not, how do I overrride the system admin email? –  syn4k Aug 19 '11 at 22:23
    
Yes, it would. You would "override" the system admin email by configuring the MTA to forward mail destined for root to another address. –  cdhowie Aug 19 '11 at 22:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.