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!
|
# 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
|
# only copy if a directory exists
|
||||||
if [ "$last_dir" ]; then
|
if [ "$last_dir" ]; then
|
||||||
echo "$($DDATE) Hard linking..."
|
last_dir=$(cd "$last_dir"; pwd -P)
|
||||||
#cd "$last_dir"
|
|
||||||
#pax -rwl -p e $VVERBOSE . "$abs_destination_dir"
|
|
||||||
rsync_hardlink="--link-dest=\"$last_dir\""
|
rsync_hardlink="--link-dest=\"$last_dir\""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo -n "$($DDATE) Creating/cloning backup directory failed."
|
|
||||||
echo " Skipping backup."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# the rsync part
|
# the rsync part
|
||||||
# options partly stolen from rsnapshot
|
# options partly stolen from rsnapshot
|
||||||
|
@ -404,11 +396,13 @@ while [ "$i" -lt "$no_sources" ]; do
|
||||||
|
|
||||||
echo "$($DDATE) Transferring files..."
|
echo "$($DDATE) Transferring files..."
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
rsync -a --delete --numeric-ids --relative --delete-excluded \
|
rsync -a --delete --numeric-ids --relative --delete-excluded \
|
||||||
$rsync_hardlink \
|
$rsync_hardlink \
|
||||||
$VERBOSE $EXCLUDE $SUMMARY $RSYNC_EXTRA \
|
$VERBOSE $EXCLUDE $SUMMARY $RSYNC_EXTRA \
|
||||||
"$source" "$abs_destination_dir"
|
"$source" "$abs_destination_dir"
|
||||||
|
set +x
|
||||||
if [ "$?" -ne 0 ]; then
|
if [ "$?" -ne 0 ]; then
|
||||||
echo "rsync reported error $?. The backup may be broken (see rsync errors)"
|
echo "rsync reported error $?. The backup may be broken (see rsync errors)"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/cat
|
#!/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
|
#!/bin/cat
|
||||||
|
|
||||||
If you see this content, pre_exec was executed.
|
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