[bugfix] relative $CCOLLECT_CONF
When the path to the cconfig-dir is specified relative in $CCOLLECT_CONF, ccollect will fail at the second backup run.
This commit is contained in:
parent
eae359da4e
commit
df9cba0502
3 changed files with 49 additions and 6 deletions
13
ccollect.sh
13
ccollect.sh
|
@ -15,7 +15,7 @@ CPOSTEXEC="$CDEFAULTS/post_exec"
|
|||
|
||||
TMP=$(mktemp /tmp/$(basename $0).XXXXXX)
|
||||
VERSION=0.4.2
|
||||
RELEASE="2006-XX-XX"
|
||||
RELEASE="2006-06-17"
|
||||
HALF_VERSION="ccollect $VERSION"
|
||||
FULL_VERSION="ccollect $VERSION ($RELEASE)"
|
||||
|
||||
|
@ -378,13 +378,16 @@ while [ "$i" -lt "$no_sources" ]; do
|
|||
echo "Creating $destination_dir ..."
|
||||
mkdir $VVERBOSE "$destination_dir"
|
||||
|
||||
#
|
||||
# make an absolute path, perhaps $CCOLLECT_CONF is relative!
|
||||
#
|
||||
abs_destination_dir=$(cd $destination_dir; pwd)
|
||||
|
||||
# only copy if a directory exists
|
||||
if [ "$last_dir" ]; then
|
||||
echo "$($DDATE) Hard linking..."
|
||||
cd "$last_dir"
|
||||
pax -rwl -p e $VVERBOSE . "$destination_dir"
|
||||
# old, gnu cp specific
|
||||
# cp -al $VVERBOSE "$last_dir" "$destination_dir"
|
||||
pax -rwl -p e $VVERBOSE . "$abs_destination_dir"
|
||||
fi
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
|
@ -402,7 +405,7 @@ while [ "$i" -lt "$no_sources" ]; do
|
|||
|
||||
rsync -a $VERBOSE $RSYNC_EXTRA $EXCLUDE $SUMMARY \
|
||||
--delete --numeric-ids --relative --delete-excluded \
|
||||
"$source" "$destination_dir"
|
||||
"$source" "$abs_destination_dir"
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "rsync reported an error. The backup may be broken (see rsync errors)"
|
||||
|
|
2
doc/TODO
2
doc/TODO
|
@ -1,3 +1,5 @@
|
|||
- ssh / rsync problem
|
||||
-> ssh noch nie genutzt
|
||||
- add --version, -V
|
||||
- hint: : in path / sed / general problem
|
||||
- hint: backuping backup
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ccollect - Installing, Configuring and Using
|
||||
============================================
|
||||
Nico Schottelius <nico-linux-ccollect__@__schottelius.org>
|
||||
0.4.1, for ccollect 0.4-0.4.1, Initial Version from 2006-01-13
|
||||
0.4.2, for ccollect 0.4-0.4.2, Initial Version from 2006-01-13
|
||||
:Author Initials: NS
|
||||
|
||||
(pseudo) incremental backup
|
||||
|
@ -71,6 +71,44 @@ subdirectory:
|
|||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Quick start
|
||||
-----------
|
||||
For those who do not want to read the whole long document:
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
# get latest ccollect tarball from http://unix.schottelius.org/ccollect/
|
||||
# replace 0.4.1 with the current version
|
||||
wget http://unix.schottelius.org/ccollect/ccollect-0.4.1.tar.bz2
|
||||
|
||||
# extract the tarball, change to the newly created directory
|
||||
tar -xvjf ccollect-0.4.1.tar.bz2
|
||||
cd ccollect-0.4.1
|
||||
|
||||
# create mini-configuration
|
||||
# first create directory structure
|
||||
mkdir -p miniconfig/defaults/intervals
|
||||
mkdir miniconfig/sources
|
||||
|
||||
# create a sample interval
|
||||
echo 42 > miniconfig/defaults/intervals/testinterval
|
||||
|
||||
# create destination directory, where the backups will be kept
|
||||
mkdir ~/DASI
|
||||
|
||||
# create sample source, which will be saved
|
||||
mkdir miniconfig/sources/testsource
|
||||
# We will save '/bin' to the directory '~/DASI'
|
||||
echo '/bin' > miniconfig/sources/testsource/source
|
||||
ln -s ~/DASI miniconfig/sources/testsource/destination
|
||||
# We want to see what happens and also a small summary at the end
|
||||
touch miniconfig/sources/testsource/verbose
|
||||
touch miniconfig/sources/testsource/summary
|
||||
|
||||
# do the backup
|
||||
CCOLLECT_CONF=./miniconfig ./ccollect.sh testinterval testsource
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
|
|
Loading…
Reference in a new issue