|
|
|
@ -4,10 +4,10 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
|
|
|
|
|
AUTHOR="(L) 2013-2015 by Orsiris \"Ozy\" de Jong"
|
|
|
|
|
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
|
|
|
|
|
PROGRAM_VERSION=1.1-pre
|
|
|
|
|
PROGRAM_BUILD=2015112805
|
|
|
|
|
PROGRAM_BUILD=2015121501
|
|
|
|
|
IS_STABLE=no
|
|
|
|
|
|
|
|
|
|
FUNC_BUILD=2015121502
|
|
|
|
|
FUNC_BUILD=2015121503
|
|
|
|
|
## BEGIN Generic functions for osync & obackup written in 2013-2015 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
|
|
|
|
|
|
|
|
|
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
|
|
|
@ -278,9 +278,9 @@ function SendAlert {
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if type mail > /dev/null 2>&1 ; then
|
|
|
|
|
if $(type -p mail) -V | grep "GNU" > /dev/null; then echo ok; fi
|
|
|
|
|
if $(type -p mail) -V | grep "GNU" > /dev/null; then
|
|
|
|
|
attachment_command="-A $ALERT_LOG_FILE"
|
|
|
|
|
elif $(type -p mail) -V; then
|
|
|
|
|
elif $(type -p mail) -V > /dev/null; then
|
|
|
|
|
attachment_command="-a $ALERT_LOG_FILE"
|
|
|
|
|
else
|
|
|
|
|
attachment_command=""
|
|
|
|
@ -923,11 +923,23 @@ function TrapStop {
|
|
|
|
|
function TrapQuit {
|
|
|
|
|
if [ $ERROR_ALERT -ne 0 ]; then
|
|
|
|
|
UnlockReplicas
|
|
|
|
|
if [ "$_DEBUG" != "yes" ]
|
|
|
|
|
then
|
|
|
|
|
SendAlert
|
|
|
|
|
else
|
|
|
|
|
Log "Debug mode, no alert mail will be sent."
|
|
|
|
|
fi
|
|
|
|
|
CleanUp
|
|
|
|
|
Logger "$PROGRAM finished with errors." "ERROR"
|
|
|
|
|
exitcode=1
|
|
|
|
|
elif [ $WARN_ALERT -ne 0 ]; then
|
|
|
|
|
UnlockReplicas
|
|
|
|
|
if [ "$_DEBUG" != "yes" ]
|
|
|
|
|
then
|
|
|
|
|
SendAlert
|
|
|
|
|
else
|
|
|
|
|
Log "Debug mode, no alert mail will be sent."
|
|
|
|
|
fi
|
|
|
|
|
CleanUp
|
|
|
|
|
Logger "$PROGRAM finished with warnings." "WARN"
|
|
|
|
|
else
|
|
|
|
|