Fixed deletion detection when bad symlinks present

This commit is contained in:
deajan 2016-10-17 09:56:40 +02:00
parent c2959fb98b
commit a57d4ab98a
1 changed files with 9 additions and 5 deletions

View File

@ -4,7 +4,7 @@ PROGRAM="osync" # Rsync based two way sync engine with fault tolerance
AUTHOR="(C) 2013-2016 by Orsiris de Jong" AUTHOR="(C) 2013-2016 by Orsiris de Jong"
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr" CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
PROGRAM_VERSION=1.2-beta PROGRAM_VERSION=1.2-beta
PROGRAM_BUILD=2016101603 PROGRAM_BUILD=2016101701
IS_STABLE=no IS_STABLE=no
# Execution order #__WITH_PARANOIA_DEBUG # Execution order #__WITH_PARANOIA_DEBUG
@ -646,9 +646,13 @@ function treeList {
## When log writing fails, $! is empty and WaitForTaskCompletion fails. Removing the 2>> log ## When log writing fails, $! is empty and WaitForTaskCompletion fails. Removing the 2>> log
eval "$rsyncCmd" eval "$rsyncCmd"
retval=$? retval=$?
## Retval 24 = some files vanished while creating list
if ([ $retval == 0 ] || [ $retval == 24 ]) && [ -f "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$replicaType.$SCRIPT_PID" ]; then if [ -f "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$replicaType.$SCRIPT_PID" ]; then
mv -f "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$replicaType.$SCRIPT_PID" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/$replicaType$treeFilename" mv -f "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$replicaType.$SCRIPT_PID" "${INITIATOR[$__replicaDir]}${INITIATOR[$__stateDir]}/$replicaType$treeFilename"
fi
## Retval 24 = some files vanished while creating list
if ([ $retval == 0 ] || [ $retval == 24 ]) then
return $? return $?
elif [ $retval == 23 ]; then elif [ $retval == 23 ]; then
Logger "Some files could not be listed in [$replicaPath]. Check for failing symlinks." "ERROR" Logger "Some files could not be listed in [$replicaPath]. Check for failing symlinks." "ERROR"
@ -1801,8 +1805,8 @@ function Usage {
fi fi
echo "$PROGRAM $PROGRAM_VERSION $PROGRAM_BUILD" echo "$PROGRAM $PROGRAM_VERSION $PROGRAM_BUILD"
echo $AUTHOR echo "$AUTHOR"
echo $CONTACT echo "$CONTACT"
echo "" echo ""
echo "You may use osync with a full blown configuration file, or use its default options for quick command line sync." echo "You may use osync with a full blown configuration file, or use its default options for quick command line sync."
echo "Usage: osync.sh /path/to/config/file [OPTIONS]" echo "Usage: osync.sh /path/to/config/file [OPTIONS]"