![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| diffrence between method call and function call in perl | Zaxon | Shell Programming and Scripting | 4 | 03-30-2009 03:28 PM |
| trapping errors | TimHortons | UNIX for Dummies Questions & Answers | 3 | 11-19-2008 11:34 AM |
| how to differentiate system call from library call | muru | UNIX for Advanced & Expert Users | 2 | 07-20-2007 12:20 AM |
| Adapter Errors and Link Errors | mcastill66 | AIX | 2 | 08-02-2005 07:51 PM |
| trapping errors while using FTP. | radhika | Shell Programming and Scripting | 5 | 05-27-2005 08:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
trapping errors from a sub call
I want to trap any errors from a backup database script and send an email when an error occurs. I can trap command errors and send an email in the following code. My problem occurs if an error occurs in the Maxl script, /opt/hyperion/AnalyticServices/bin/essmsh < MaxlScript.msh..., that is called to back up the database. Is there a way I can trap an error that is returned from the Maxl script.
Code:
#!/usr/bin/ksh -v
error_message()
{
mailx -s "Essbase backup error" email user Id. < BackupError.txt
}
trap 'error_message' ERR
set -e
cd /opt/hyperion/HYP_BACKUP/scripts
/opt/hyperion/AnalyticServices/bin/essmsh < /opt/staff/srv-plan9/MaxlScript.msh > /opt/staff/srv-plan9/Maxl.log 2>$1
exit
Tom |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|