diff --git a/ccollect.sh b/ccollect.sh index 91675b3..fab21c1 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -381,13 +381,7 @@ while [ "$i" -lt "$no_sources" ]; do # # make an absolute path, perhaps $CCOLLECT_CONF is relative! # - abs_destination_dir=$(cd $destination_dir; pwd -P) - - # only copy if a directory exists - if [ "$last_dir" ]; then - last_dir=$(cd "$last_dir"; pwd -P) - rsync_hardlink="--link-dest=\"$last_dir\"" - fi + abs_destination_dir="$(cd $destination_dir; pwd -P)" # # the rsync part @@ -398,6 +392,12 @@ while [ "$i" -lt "$no_sources" ]; do set -x + # Clone from previous backup, if existing + if [ "$last_dir" ]; then + last_dir="$(cd "$last_dir"; pwd -P)" + rsync_hardlink="--link-dest=\"$last_dir\"" + fi + rsync -a --delete --numeric-ids --relative --delete-excluded \ $rsync_hardlink \ $VERBOSE $EXCLUDE $SUMMARY $RSYNC_EXTRA \