LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-11-2009, 08:17 PM   #1
mirror51
LQ Newbie
 
Registered: Jul 2009
Posts: 12

Rep: Reputation: 0
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
 
Old 08-11-2009, 08:42 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
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
 
Old 08-12-2009, 12:41 AM   #3
mirror51
LQ Newbie
 
Registered: Jul 2009
Posts: 12

Original Poster
Rep: Reputation: 0
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
 
Old 08-12-2009, 01:01 AM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Way To Have Output Of Cron Job Emailed jmoschetti45 Linux - General 1 05-22-2007 01:42 AM
how to make cron not send email? bbeers Slackware 7 11-11-2005 10:31 AM
usin AWK in cron job to send dynamic ip via email digihlp Programming 2 12-10-2003 08:10 AM
Cron job , send email mikeshn Linux - General 1 09-21-2003 09:02 AM
Send Email + Txt Attachment Using Cron Job beringer Linux - Newbie 3 01-31-2003 10:23 AM


All times are GMT -5. The time now is 12:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration