The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

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-27-2008 01:20 AM
at vs cronjob mokkan SUN Solaris 1 05-17-2008 12:50 AM
Cronjob - Redirect mail output to file, LINES & COLUMNS jharvey Shell Programming and Scripting 0 04-14-2008 04:19 PM
cannot run cronjob shahrahulb UNIX for Advanced & Expert Users 3 10-28-2004 10:45 AM
Cronjob gerwhelan Shell Programming and Scripting 4 12-14-2001 06:17 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-06-2002
i2admin i2admin is offline
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
  #2 (permalink)  
Old 11-06-2002
Vishnu Vishnu is offline
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 (permalink)  
Old 11-06-2002
LivinFree's Avatar
LivinFree LivinFree is offline Forum Advisor  
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 (permalink)  
Old 11-08-2002
i2admin i2admin is offline
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 (permalink)  
Old 11-08-2002
RTM's Avatar
RTM RTM is offline Forum Advisor  
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 (permalink)  
Old 11-08-2002
Captain Kirk Captain Kirk is offline
Registered User
  
 

Join Date: Nov 2002
Location: The final frontier
Posts: 3
take a look in the following places:
Code:
/etc/crontab
/etc/aliases
  #7 (permalink)  
Old 11-15-2002
roden roden is offline
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
Closed Thread

Bookmarks

Tags
sendmail

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0