The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

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 04-29-2009
t_coop t_coop is offline
Registered User
  
 

Join Date: Apr 2009
Posts: 4
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
Thanks,
Tom
Closed Thread

Bookmarks

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 10:33 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