diff --git a/dev/n_osync.sh b/dev/n_osync.sh index 7cf8ce8..2599a6b 100755 --- a/dev/n_osync.sh +++ b/dev/n_osync.sh @@ -3,8 +3,8 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance AUTHOR="(C) 2013-2016 by Orsiris de Jong" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" -PROGRAM_VERSION=1.1.5 -PROGRAM_BUILD=2016111701 +PROGRAM_VERSION=1.1.6-beta +PROGRAM_BUILD=2016113001 IS_STABLE=yes source "./ofunctions.sh" @@ -28,7 +28,7 @@ function TrapStop { } function TrapQuit { - local exitcode= + local exitcode # Get ERROR / WARN alert flags from subprocesses that call Logger if [ -f "$RUN_DIR/$PROGRAM.Logger.warn.$SCRIPT_PID" ]; then @@ -1652,7 +1652,6 @@ do ;; --initiator=*) _QUICK_SYNC=$(($_QUICK_SYNC + 1)) - no_maxtime=1 INITIATOR_SYNC_DIR=${i##*=} opts=$opts" --initiator=\"$INITIATOR_SYNC_DIR\"" ;; @@ -1660,7 +1659,6 @@ do _QUICK_SYNC=$(($_QUICK_SYNC + 1)) TARGET_SYNC_DIR=${i##*=} opts=$opts" --target=\"$TARGET_SYNC_DIR\"" - no_maxtime=1 ;; --rsakey=*) SSH_RSA_PRIVATE_KEY=${i##*=} @@ -1772,7 +1770,7 @@ opts="${opts# *}" GetRemoteOS InitRemoteOSSettings - if [ $no_maxtime -eq 1 ]; then + if [ $no_maxtime -eq 1 ] ; then SOFT_MAX_EXEC_TIME=0 HARD_MAX_EXEC_TIME=0 fi diff --git a/dev/ofunctions.sh b/dev/ofunctions.sh index 5469d6d..5a1ca53 100644 --- a/dev/ofunctions.sh +++ b/dev/ofunctions.sh @@ -1,4 +1,4 @@ -## FUNC_BUILD=2016071902-g +## FUNC_BUILD=2016071902-h ## BEGIN Generic functions for osync & obackup written in 2013-2016 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 @@ -38,14 +38,16 @@ fi #__WITH_PARANOIA_DEBUG ## allow debugging from command line with _DEBUG=yes if [ ! "$_DEBUG" == "yes" ]; then _DEBUG=no - SLEEP_TIME=.1 _VERBOSE=0 else - SLEEP_TIME=1 trap 'TrapError ${LINENO} $?' ERR _VERBOSE=1 fi +if [ "$SLEEP_TIME" == "" ]; then + SLEEP_TIME=.1 +fi + SCRIPT_PID=$$ LOCAL_USER=$(whoami) @@ -764,10 +766,10 @@ function WaitForTaskCompletion { KillChilds $pid if [ $? == 0 ]; then Logger "Task stopped successfully" "NOTICE" - return 0 else - return 1 + Logger "Could not stop task" "ERROR" fi + return 1 fi fi sleep $SLEEP_TIME @@ -814,10 +816,16 @@ function WaitForCompletion { KillChilds $pid if [ $? == 0 ]; then Logger "Task stopped successfully" "NOTICE" - return 0 else - return 1 + Logger "Could not stop task" "ERROR" fi + return 1 + #if [ $? == 0 ]; then + # Logger "Task stopped successfully" "NOTICE" + # return 0 + #else + # return 1 + #fi fi fi sleep $SLEEP_TIME