More preparations for removal of pax
Use pwd -P to get real path
This commit is contained in:
parent
2060baa71a
commit
ec6bb69c75
4 changed files with 8 additions and 13 deletions
16
ccollect.sh
16
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
|
||||
|
|
|
@ -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)
|
||||
######################################################################
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/cat
|
||||
|
||||
If you see this content, pre_exec was executed.
|
||||
(general pre_exec, not source dependent)
|
||||
|
|
|
@ -1 +1 @@
|
|||
/home/nico/backupdir/testsource1
|
||||
/home/user/nico/backupdir/testsource1
|
Loading…
Reference in a new issue