Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2010 07:58 AM
тАО02-15-2010 07:58 AM
Cron
I need find a solution for cron tasks y need send a email when some tasks fail only when fail
someone see this case
thks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2010 08:06 AM
тАО02-15-2010 08:06 AM
Re: Cron
check this link :
http://www.unix.com/unix-dummies-questions-answers/5127-email-when-cron-fails.html
mikap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2010 08:25 AM
тАО02-15-2010 08:25 AM
Re: Cron
This needs to be handled inside the cron script.
cron itself can email not at all, or every time the script runs.
So build this into the script cron calls:
# Get the return code from the important process
rc=$?
#
if [ $rc -eq 0 ]
then
echo "Process succeeded"
else
echo "Process failed | mailx -s "Job blah blah failed" yourmailbox@yourdomain.com
fi
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2010 09:00 AM
тАО02-15-2010 09:00 AM
Re: Cron
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2010 12:48 PM
тАО02-15-2010 12:48 PM
Re: Cron
A 'crontab' job will generate a mail to the controlling account whenever *either* STDOUT or STDERR is produced and the output isn't redirected.
Well-behaved processes (and scripts) produce their desired output to STDOUT and any warnings or errors to STDERR. Thus, if this were the case for your process, you could suppress mail generation, except for error conditions, with:
# /usr/local/bin/mything > /var/tmp/mything.log
...assuming that if there is a warning or error, that information would be written to the un-redirected STDERR which would then trigger a mail event under 'cron'.
The success or failure of a process as cataloged in its return code has nothing to do with weather or not STDERR (or for that matter, STDOUT) might be written. You need to know what rules your process follows.
Regards!
...JRF...