Fix for snapsend.sh:
- If error during sending snapshot to remote host, the script exist on the first error instead of sending two mails.
This commit is contained in:
parent
a98cb084ba
commit
d0e710ba1e
|
@ -112,8 +112,10 @@ case "${interval}" in
|
||||||
printf ' ... DONE\n' >> $LOGFILE
|
printf ' ... DONE\n' >> $LOGFILE
|
||||||
else
|
else
|
||||||
# Mail admin
|
# Mail admin
|
||||||
printf 'ERROR snapshot %s does not exist on the local system\n' ${DHOSTSNAP} | mail ${MAILADMIN} -s "snapsend_error $(hostname -f)"
|
printf 'ERROR Connection SSH or snapshot >%s< does not exist on the local system\n' ${DHOSTSNAP} | mail ${MAILADMIN} -s "snapsend_error $(hostname -f)"
|
||||||
printf 'ERROR snapshot %s for %s does not exist on the local system\n' ${DHOSTSNAP} ${dset} >> $LOGFILE
|
printf 'ERROR snapshot %s for %s does not exist on the local system\n' ${DHOSTSNAP} ${dset} >> $LOGFILE
|
||||||
|
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test if the snapshot was successfully receive on the remote host
|
# Test if the snapshot was successfully receive on the remote host
|
||||||
|
@ -126,6 +128,8 @@ case "${interval}" in
|
||||||
# Mail admin
|
# Mail admin
|
||||||
printf 'ERROR snapshot %s for %s does not exist on the remote host (%s)\n' ${LOCALSNAP} ${dset} ${DHOST} | mail ${MAILADMIN} -s "snapsend_error $(hostname -f)"
|
printf 'ERROR snapshot %s for %s does not exist on the remote host (%s)\n' ${LOCALSNAP} ${dset} ${DHOST} | mail ${MAILADMIN} -s "snapsend_error $(hostname -f)"
|
||||||
printf 'ERROR snapshot %s for %s does not exist on the remote host (%s)\n' ${LOCALSNAP} ${dset} ${DHOST} >> $LOGFILE
|
printf 'ERROR snapshot %s for %s does not exist on the remote host (%s)\n' ${LOCALSNAP} ${dset} ${DHOST} >> $LOGFILE
|
||||||
|
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue