View Single Post
  #7 (permalink)  
Old 06-10-09, 08:13
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,455
Cool End of days...

What did you NOT understand about Mike's and pdreyer's solution?

Adding to those alternatives, you could just add code at the end of the script to e-mail the log:
Code:
#!/bin/ksh
# this is myScript.sh
#
LOG_FILE=/path/to/logs/myScript.log
#
dosomething.sh >$LOG_FILE
if [ $? -ne 0]
then
  cat $LOG_FILE| mailx -s "$0 !ERROR, something happened." oper@mydomain.com
  exit 1
fi
#-- Etc --
dosomethingelse.sh >>$LOG_FILE
#-- Etc --
# At end of the script add:
cat $LOG_FILE| mailx -s "$0 All OK!" oper@mydomain.com
exit 0
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote