mirror of
https://github.com/deajan/obackup.git
synced 2024-12-27 07:53:40 +01:00
Improved logging output
This commit is contained in:
parent
2c55108ba6
commit
809e6a1d4f
@ -5,7 +5,7 @@ PROGRAM="obackup"
|
|||||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
||||||
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
||||||
PROGRAM_VERSION=2.1-dev
|
PROGRAM_VERSION=2.1-dev
|
||||||
PROGRAM_BUILD=2016082601
|
PROGRAM_BUILD=2016082602
|
||||||
IS_STABLE=no
|
IS_STABLE=no
|
||||||
|
|
||||||
source "./ofunctions.sh"
|
source "./ofunctions.sh"
|
||||||
@ -38,18 +38,18 @@ function TrapQuit {
|
|||||||
local exitcode
|
local exitcode
|
||||||
|
|
||||||
if [ $ERROR_ALERT -ne 0 ]; then
|
if [ $ERROR_ALERT -ne 0 ]; then
|
||||||
SendAlert
|
|
||||||
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
||||||
RunAfterHook
|
RunAfterHook
|
||||||
fi
|
fi
|
||||||
|
SendAlert
|
||||||
CleanUp
|
CleanUp
|
||||||
Logger "Backup script finished with errors." "ERROR"
|
Logger "Backup script finished with errors." "ERROR"
|
||||||
exitcode=1
|
exitcode=1
|
||||||
elif [ $WARN_ALERT -ne 0 ]; then
|
elif [ $WARN_ALERT -ne 0 ]; then
|
||||||
SendAlert
|
|
||||||
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
if [ "$RUN_AFTER_CMD_ON_ERROR" == "yes" ]; then
|
||||||
RunAfterHook
|
RunAfterHook
|
||||||
fi
|
fi
|
||||||
|
SendAlert
|
||||||
CleanUp
|
CleanUp
|
||||||
Logger "Backup script finished with warnings." "WARN"
|
Logger "Backup script finished with warnings." "WARN"
|
||||||
exitcode=2
|
exitcode=2
|
||||||
@ -998,7 +998,7 @@ function CheckTotalExecutionTime {
|
|||||||
if [ $SECONDS -gt $SOFT_MAX_EXEC_TIME_TOTAL ]; then
|
if [ $SECONDS -gt $SOFT_MAX_EXEC_TIME_TOTAL ]; then
|
||||||
Logger "Max soft execution time of the whole backup exceeded." "ERROR"
|
Logger "Max soft execution time of the whole backup exceeded." "ERROR"
|
||||||
WARN_ALERT=1
|
WARN_ALERT=1
|
||||||
SendAlert
|
SendAlert true
|
||||||
if [ $SECONDS -gt $HARD_MAX_EXEC_TIME_TOTAL ] && [ $HARD_MAX_EXEC_TIME_TOTAL -ne 0 ]; then
|
if [ $SECONDS -gt $HARD_MAX_EXEC_TIME_TOTAL ] && [ $HARD_MAX_EXEC_TIME_TOTAL -ne 0 ]; then
|
||||||
Logger "Max hard execution time of the whole backup exceeded, stopping backup process." "CRITICAL"
|
Logger "Max hard execution time of the whole backup exceeded, stopping backup process." "CRITICAL"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -267,9 +267,9 @@ function SendAlert {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $runAlert == true ]; then
|
if [ $runAlert == true ]; then
|
||||||
subject="Current run $subject"
|
subject="Currently runing - $subject"
|
||||||
else
|
else
|
||||||
subject="Fnished run $subject"
|
subject="Fnished run - $subject"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$mail_no_attachment" -eq 0 ]; then
|
if [ "$mail_no_attachment" -eq 0 ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user