{
infomsg "$computer:$filesystem $backuplevel backup\n"
- SNARFILE="${storagedir}/${computer}/${sfilesystem}/.incremental.snar"
- incrementalsnar="/root/.backup/${sfilesystem}.snar"
+ localsnar="${storagedir}/${computer}/${sfilesystem}/.incremental.snar"
+ remotesnar="/root/.backup/${sfilesystem}.snar"
if [ "$backuplevel" = "daglig" ]; then
# If incremental backup, we need to copy the incremental status to $computer.
# If it does not exist, whine a bit and then run date-based instead.
- if [ -s "$SNARFILE" ]; then
- if ! scp $SNARFILE root@$computer:$incrementalsnar; then
+ if [ -s "$localsnar" ]; then
+ if ! scp $localsnar root@$computer:$remotesnar; then
diemsg "Could not copy .incremental.snar to $computer"
fi
- lastcmd="--listed-incremental=$incrementalsnar --no-check-device"
+ lastcmd="--listed-incremental=$remotesnar --no-check-device"
else
infomsg "Missing incremental.snar for $filesystem, doing date-based backup instead until next full backup"
- incrementalsnar=""
+ remotesnar=""
lastd=`cat ../.date`
lastcmd="--newer='$lastd'"
fi
else
- lastcmd="--listed-incremental=$incrementalsnar"
+ # Note: Since we rm-ed .backup previously, and we don't scp over
+ # anything in this branch, this file will not exist, and we
+ # will be doing a full backup (but we want the output of it).
+ lastcmd="--listed-incremental=$remotesnar"
fi
# We try to run tar on the remote computer
if [ $? -eq 0 ] && [ -s $TARFILE ]; then
# File is >0 in size and neither cat or tar tzvf failed; we assume it worked.
- if [ "$incrementalsnar" ]; then
- if ! scp root@$computer:$incrementalsnar $SNARFILE.tmp; then
+ if [ "$remotesnar" ]; then
+ if ! scp root@$computer:$remotesnar $localsnar.tmp; then
diemsg "Could not copy .incremental.snar from $computer"
fi
fi
# Move tar file in place
mv $TARFILE $DATE.tgz
- if [ "$incrementalsnar" ]; then
- mv $SNARFILE.tmp $SNARFILE
+ if [ "$remotesnar" ]; then
+ mv $localsnar.tmp $localsnar
fi
# Update timestamp