mirror of
https://github.com/deajan/obackup.git
synced 2026-02-05 22:55:14 +01:00
Added an option to run after exec cmd on error
This commit is contained in:
@@ -1085,15 +1085,24 @@ function TrapQuit {
|
||||
|
||||
if [ $ERROR_ALERT -ne 0 ]; then
|
||||
SendAlert
|
||||
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
||||
RunAfterHook
|
||||
fi
|
||||
CleanUp
|
||||
Logger "Backup script finished with errors." "ERROR"
|
||||
exitcode=1
|
||||
elif [ $WARN_ALERT -ne 0 ]; then
|
||||
SendAlert
|
||||
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
||||
RunAfterHook
|
||||
fi
|
||||
CleanUp
|
||||
Logger "Backup script finished with warnings." "WARN"
|
||||
exitcode=2
|
||||
else
|
||||
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
||||
RunAfterHook
|
||||
fi
|
||||
CleanUp
|
||||
Logger "Backup script finshed." "NOTICE"
|
||||
exitcode=0
|
||||
|
||||
@@ -36,15 +36,24 @@ function TrapQuit {
|
||||
|
||||
if [ $ERROR_ALERT -ne 0 ]; then
|
||||
SendAlert
|
||||
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
||||
RunAfterHook
|
||||
fi
|
||||
CleanUp
|
||||
Logger "Backup script finished with errors." "ERROR"
|
||||
exitcode=1
|
||||
elif [ $WARN_ALERT -ne 0 ]; then
|
||||
SendAlert
|
||||
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
||||
RunAfterHook
|
||||
fi
|
||||
CleanUp
|
||||
Logger "Backup script finished with warnings." "WARN"
|
||||
exitcode=2
|
||||
else
|
||||
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
||||
RunAfterHook
|
||||
fi
|
||||
CleanUp
|
||||
Logger "Backup script finshed." "NOTICE"
|
||||
exitcode=0
|
||||
|
||||
Reference in New Issue
Block a user