diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b82029..6306eef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/obackup.sh b/obackup.sh index 4155740..43d7b7b 100755 --- a/obackup.sh +++ b/obackup.sh @@ -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 ]