Using the post_olb_script so updated to test the dd_save.pl return code:
ss_db_filename=$1
compress=$2
backupID=$3
time_string=$4
retval=0
## Do an online save of the InnoDB DDM database every Sunday using Mysql Enterprise Backup
#
# The following is an example of the use of this script. If you wish to
# enable this functionality, just uncomment the following lines.
#
day_of_week=`date +%w`
target_day=0
#target_day=4
if [ $day_of_week -eq $target_day ]
then
cd $SPECROOT/SS/DDM
backup_dir=`dirname $ss_db_filename`
./ddm_save.pl -f $backup_dir/db_$time_string.DDMDb > $backup_dir/ddm_backup.log 2>&1
retval=$?
if [ retval -eq 0]
then
echo "ddm_save.pl/mysqlbackup is successful !!!" >> $backup_dir/ddm_backup.log
else
echo "ddm_save.pl/mysqlbackup has failed with an error code: $retval" >> $backup_dir/ddm_backup.log
fi
fi
exit $retval
In the ddm_backup.log file even if the backup completes successfully you can see the following messages:
...
mysqlbackup completed OK!
ddm_save.pl/mysqlbackup has failed with an error code: 0
Release : 10.4.3
Component :
Use -ne (not equal) instead of -eq (equal) to test the retvat
if [ retval -ne 0 ]
then
echo "ddm_save.pl/mysqlbackup1 has failed with an error code: $retval" >> $backup_dir/ddm_backup.log
else
echo "ddm_save.pl/mysqlbackup1 is successful !!!" >> $backup_dir/ddm_backup.log
fi