The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
Google UNIX.COM


UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to forward mail in /var/mail/username to external mail unitipon SUN Solaris 2 05-26-2008 09:20 PM
at vs cronjob mokkan SUN Solaris 1 05-16-2008 08:50 PM
Cronjob - Redirect mail output to file, LINES & COLUMNS jharvey Shell Programming and Scripting 0 04-14-2008 12:19 PM
cannot run cronjob shahrahulb UNIX for Advanced & Expert Users 3 10-28-2004 06:45 AM
Cronjob gerwhelan Shell Programming and Scripting 4 12-14-2001 03:17 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-06-2002
Registered User
 

Join Date: May 2002
Posts: 21
Question mail from Cronjob

Hi,
I'm having a HP UX 11i and 11.0 . I've given the cron access to one of the user. Now he is getting mails on errors only and not on success on execution of the command. How can i make sure that the mail is sent in both the cases of success and failure. Also the mail is going to the lotus notes mailbox. Where can i change it, and sent the mail to his unix mail box only?
Thanks
Dhanish
Forum Sponsor
  #2  
Old 11-06-2002
Registered User
 

Join Date: Aug 2002
Location: Marlboro, MA
Posts: 114
Provide us with more information.. the command and all...

Is the mail (or mailx) command issued from crontab or command line?

Cheers!
Vishnu.
  #3  
Old 11-06-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
No crond I've ever seen mails on success, just failures.
You can set up the program/script/command to mail on success...

For the other issue, try reading the results of the command "man crontab"
  #4  
Old 11-08-2002
Registered User
 

Join Date: May 2002
Posts: 21
I'm not mentioning about any specific command. I get the mail only on faliure, regardless on the command i use. Now i want to know where can i change this, like say if i want to change the failure mails to be sent to user@hostname.com rather than to user@company.com ? I was not able to find it in the man pages as well. Hope it clear this time
  #5  
Old 11-08-2002
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Do your cron entries have 2>&1 in them? If so, this is telling it to send email only on failure. Cron usually sends email on success or failure. Most people don't want the successful ones, only wanting to know when it failed. Or they just send output to a log file to look at it later (or mail the log file after the job is completed).

To change where the email goes, either set it up that the output goes to a log file and email the results after the job is done to the different user, OR you can change the alias for user@hostname to send mail to user@company.com.

Or someone can give another option -
  #6  
Old 11-08-2002
Registered User
 

Join Date: Nov 2002
Location: The final frontier
Posts: 3
take a look in the following places:
Code:
/etc/crontab
/etc/aliases
__________________
<hr>
Captain James T Kirk
USS Enterprise
  #7  
Old 11-15-2002
Registered User
 

Join Date: Nov 2002
Posts: 14
The following sends email to a loguser with the output from the "command".


crontab entry for the user:
* * * * * /path/command 2>&1 | mail -s "command report rc=4?" logmaster

/etc/aliases file directing email to root at the local host:
logmaster: root@localhost

compile the aliases file with sendmail -bi
Google The UNIX and Linux Forums
Closed Thread

Tags
sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:28 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0