lastcmd="--listed-incremental=$incrementalsnar"
fi
- # expand the exclude-path for use with tar
- exf=`ssh root@$computer "ls ~/.backup/exclude"`
-
# We try to run tar on the remote computer
# c create archive
# C change to directory first
# file and build a file list, respectivly.
TARFILE=$DATE.tmp
TARCMD="ssh root@$computer \"nice -n 19 ionice -c3 tar --one-file-system --use-compress-program $compressor -cf - -C $filesystem . $lastcmd \
- --exclude-from=$exf\" | pee \"cat > $TARFILE\" \"tar tzvf -\""
+ --exclude-from=/root/.backup/exclude\" | pee \"cat > $TARFILE\" \"tar tzvf -\""
echo `date`" $computer: Running $TARCMD" >&2
eval $TARCMD > $DATE.idx
| awk '{ if ( $(NF-1) != "0" ) print $2}' `
# Clean up our dir at this client
-if ! ssh root@$computer "rm -r ~/.backup ; mkdir -m 700 ~/.backup"; then
- echo `date`" $computer: Could not create backup staging area at $computer:~/.backup"
+if ! ssh root@$computer "rm -r /root/.backup ; mkdir -m 700 /root/.backup"; then
+ echo `date`" $computer: Could not create backup staging area at $computer:/root/.backup"
die
fi
# Try to copy $exclude to $computer
-if ! scp $exclude root@$computer:~/.backup/exclude > /dev/null; then
+if ! scp $exclude root@$computer:/root/.backup/exclude > /dev/null; then
echo `date`" $computer: Could not copy exclude.txt to $computer"
die
fi
# Try to copy preeexec and postexec if they exist
if [ -f $confdir/preexec.$computer ]; then
- if ! scp $confdir/preexec.$computer root@$computer:~/.backup/preexec >&2; then
- echo `date`" $computer: Could not copy preexec.$computer to $computer:~/.backup/preexec"
+ if ! scp $confdir/preexec.$computer root@$computer:/root/.backup/preexec >&2; then
+ echo `date`" $computer: Could not copy preexec.$computer to $computer:/root/.backup/preexec"
die
fi
fi
if [ -f $confdir/postexec.$computer ]; then
- if ! scp $confdir/postexec.$computer root@$computer:~/.backup/postexec >&2; then
- echo `date`" $computer: Could not copy postexec.$computer to $computer:~/.backup/postexec"
+ if ! scp $confdir/postexec.$computer root@$computer:/root/.backup/postexec >&2; then
+ echo `date`" $computer: Could not copy postexec.$computer to $computer:/root/.backup/postexec"
die
fi
fi
# Try to run preexec if it exists
-if ! ssh root@$computer "[ ! -f ~/.backup/preexec ] || /bin/bash -x ~/.backup/preexec" >&2; then
- echo `date`" $computer: Could not run $computer:~/.backup/preexec"
+if ! ssh root@$computer "[ ! -f /root/.backup/preexec ] || /bin/bash -x /root/.backup/preexec" >&2; then
+ echo `date`" $computer: Could not run $computer:/root/.backup/preexec"
die
fi
done
# Try to run postexec if it exist
-if ! ssh root@$computer "[ ! -f ~/.backup/postexec ] || /bin/bash -x ~/.backup/postexec" >&2; then
- echo `date`" $computer: Could not run $computer:~/.backup/postexec"
+if ! ssh root@$computer "[ ! -f /root/.backup/postexec ] || /bin/bash -x /root/.backup/postexec" >&2; then
+ echo `date`" $computer: Could not run $computer:/root/.backup/postexec"
die
fi