Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

backup_exit_notify script not working

Updated: 22 May 2010 | 3 comments
Russell Manaois's picture
0 0 Votes
Login to vote
This issue has been solved. See solution.

Environment:  NBU 6.0MP4  Solaris 10

In November 2008, I modified the backup_exit_notify script to email Unix and Windows server admins of backup statuses other than 0 or 1.  The notifications had been working fine until the end of last month.  No changes have been made (as far as I know) to the backup or email environments.  I can send simple mail messages from the backup server using mailx, so this does not seem to be the problem.  I ran the backup_exit_notify script directly with test parameters and still no email notification.

Here is the modified code:

if [ "$5" -gt 1 ]; then # backup failed
if [ "$1" = "apollo" ]; then # notify DBAs
cat $OUTF | mailx -s "<SERVER> Backup Failure on CLIENT $1 STATUS $5" <list of Unix Admins>
else # notify Windows admin
cat $OUTF | mailx -s "<SERVER> Backup Failure on CLIENT $1 STATUS $5" <list of Windows Admins>
fi
fi

Any assistance is greatly appreciated.  Thank you.

--Russell

Comments

scorpy_582's picture
30
Apr
2009
1 Vote +1
Login to vote

script looks good

Script looks ok to me and I dont see a reason why it should fail.
Some very basic things to debug scripts, which I would try.. May be you have already done

- Run it with -x to debug.
- Print out your variables at all steps.
- use exit status


Russell Manaois's picture
30
Apr
2009
0 Votes 0
Login to vote

Resolved: syntax incorrect

Problem solved...incorrect syntax was used in the if conditional (missed spaces between brackets and conditional statement)...

if ["$5" -gt 1] ===> if [  "$5"  -gt  1  ]
                                                  

Thanks!

wr's picture
01
May
2009
0 Votes 0
Login to vote

funny thing,

your original post has the correct spacing. 

good Will backing-up