LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to make root cron job to send email if there is output (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-make-root-cron-job-to-send-email-if-there-is-output-746870/)

mirror51 08-11-2009 08:17 PM

how to make root cron job to send email if there is output
 
I am executing cron jobs through root.
But i don't receive any email even if there is any eror or ouput.


is there any place where i can add my email address so that i get the email if there is any output with root

kbp 08-11-2009 08:42 PM

Hi mirror51,

There are a few things you will need to check:

Is there a line in /etc/crontab like:
MAILTO=root@yourhostname.tld

Is roots email being redirected, 'grep ^root /etc/aliases' and if so who to?

Do you have a local mta (sendmail|postfix|exim) running ?

Is it configured appropriately to send non-local email?

You will need to dig a bit deeper...

cheers

mirror51 08-12-2009 12:41 AM

My all the default emails address was empty for root.
I went to whm with root aadded the email address there.

I do received an email but it has many lines like this

stdin: is not a tty
stdin: is not a tty
stdin: is not a tty
stdin: is not a tty
stdin: is not a tty
stdin: is not a tty

Why is that

kbp 08-12-2009 01:01 AM

A quick google found this:

"Its due to mesg y line which you can find in /etc/bashrc or in ~/.bashrc or ~/.profile file."

Ref:
http://platonic.techfiz.info/2008/10...-is-not-a-tty/

Please try commenting out this line and see if the problem persists

cheers


All times are GMT -5. The time now is 05:37 AM.