diff --git a/ccollect.sh b/ccollect.sh index 9480246..91675b3 100755 --- a/ccollect.sh +++ b/ccollect.sh @@ -381,22 +381,14 @@ while [ "$i" -lt "$no_sources" ]; do # # make an absolute path, perhaps $CCOLLECT_CONF is relative! # - abs_destination_dir=$(cd $destination_dir; pwd) + abs_destination_dir=$(cd $destination_dir; pwd -P) # only copy if a directory exists if [ "$last_dir" ]; then - echo "$($DDATE) Hard linking..." - #cd "$last_dir" - #pax -rwl -p e $VVERBOSE . "$abs_destination_dir" + last_dir=$(cd "$last_dir"; pwd -P) rsync_hardlink="--link-dest=\"$last_dir\"" fi - if [ $? -ne 0 ]; then - echo -n "$($DDATE) Creating/cloning backup directory failed." - echo " Skipping backup." - exit 1 - fi - # # the rsync part # options partly stolen from rsnapshot @@ -404,11 +396,13 @@ while [ "$i" -lt "$no_sources" ]; do echo "$($DDATE) Transferring files..." + set -x + rsync -a --delete --numeric-ids --relative --delete-excluded \ $rsync_hardlink \ $VERBOSE $EXCLUDE $SUMMARY $RSYNC_EXTRA \ "$source" "$abs_destination_dir" - + set +x if [ "$?" -ne 0 ]; then echo "rsync reported error $?. The backup may be broken (see rsync errors)" fi diff --git a/conf/defaults/post_exec b/conf/defaults/post_exec index 2192fec..2965574 100755 --- a/conf/defaults/post_exec +++ b/conf/defaults/post_exec @@ -1,5 +1,5 @@ #!/bin/cat ###################################################################### -If you see this content, post_exec was executed. +If you see this content, post_exec was executed. (general post_exec) ###################################################################### diff --git a/conf/defaults/pre_exec b/conf/defaults/pre_exec index eb983c8..09084a6 100755 --- a/conf/defaults/pre_exec +++ b/conf/defaults/pre_exec @@ -1,3 +1,4 @@ #!/bin/cat If you see this content, pre_exec was executed. +(general pre_exec, not source dependent) diff --git a/conf/sources/testsource1/destination b/conf/sources/testsource1/destination index 4d5c4a0..8de582a 120000 --- a/conf/sources/testsource1/destination +++ b/conf/sources/testsource1/destination @@ -1 +1 @@ -/home/nico/backupdir/testsource1 \ No newline at end of file +/home/user/nico/backupdir/testsource1 \ No newline at end of file