1
0
mirror of https://github.com/deajan/obackup.git synced 2024-11-12 19:03:42 +01:00

Another fix for symlinks to dirs on target

This commit is contained in:
deajan 2014-11-19 17:20:49 +01:00
parent b0e7770df2
commit efefe2df19
2 changed files with 8 additions and 3 deletions

View File

@ -23,6 +23,7 @@ KNOWN ISSUES
CHANGELOG
---------
- Fixed another issue with existing symlinks to directories on target on non recursive backups
- Fixed remaining rsync -E option preventing obackup to work correctly on MacOS X
- Fixed an issue with existing symlinks to directories on target
- Prevent changed IFS to make ping commands fail

View File

@ -5,7 +5,7 @@
AUTHOR="(L) 2013-2014 by Orsiris \"Ozy\" de Jong"
CONTACT="http://www.netpower.fr/osync - ozy@netpower.fr"
PROGRAM_VERSION=1.84preRC4
PROGRAM_BUILD=1911201401
PROGRAM_BUILD=1911201402
## type doesn't work on platforms other than linux (bash). If if doesn't work, always assume output is not a zero exitcode
if ! type -p "$BASH" > /dev/null
@ -987,6 +987,10 @@ function Rsync
if [ "$2" == "no-recurse" ]
then
RSYNC_EXCLUDE=$RSYNC_EXCLUDE" --exclude=*/*/"
# Fixes symlinks to directories in target cannot be deleted when backing up root directory without recursion
RSYNC_NO_RECURSE_ARGS=" -k"
else
RSYNC_NO_RECURSE_ARGS=""
fi
if [ ! -d $local_file_storage_path ]
@ -1003,9 +1007,9 @@ function Rsync
LogError "Connectivity test failed. Stopping current task."
exit 1
fi
rsync_cmd="$(type -p $RSYNC_EXECUTABLE) $RSYNC_ARGS --stats $RSYNC_DELETE $RSYNC_EXCLUDE --rsync-path=\"$RSYNC_PATH\" -e \"$RSYNC_SSH_CMD\" \"$REMOTE_USER@$REMOTE_HOST:$1\" \"$local_file_storage_path\" > $RUN_DIR/obackup_rsync_output_$SCRIPT_PID 2>&1"
rsync_cmd="$(type -p $RSYNC_EXECUTABLE) $RSYNC_ARGS $RSYNC_NO_RECURSE_ARGS --stats $RSYNC_DELETE $RSYNC_EXCLUDE --rsync-path=\"$RSYNC_PATH\" -e \"$RSYNC_SSH_CMD\" \"$REMOTE_USER@$REMOTE_HOST:$1\" \"$local_file_storage_path\" > $RUN_DIR/obackup_rsync_output_$SCRIPT_PID 2>&1"
else
rsync_cmd="$(type -p $RSYNC_EXECUTABLE) $RSYNC_ARGS --stats $RSYNC_DELETE $RSYNC_EXCLUDE --rsync-path=\"$RSYNC_PATH\" \"$1\" \"$local_file_storage_path\" > $RUN_DIR/obackup_rsync_output_$SCRIPT_PID 2>&1"
rsync_cmd="$(type -p $RSYNC_EXECUTABLE) $RSYNC_ARGS $RSYNC_NO_RECURSE_ARGS --stats $RSYNC_DELETE $RSYNC_EXCLUDE --rsync-path=\"$RSYNC_PATH\" \"$1\" \"$local_file_storage_path\" > $RUN_DIR/obackup_rsync_output_$SCRIPT_PID 2>&1"
fi
#### Eval is used so the full command is processed without bash adding single quotes round variables
if [ $verbose -eq 1 ]