backup_exit_notify script not working
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
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
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!
funny thing,
your original post has the correct spacing.
good Will backing-up
Would you like to reply?
Login or Register to post your comment.