X-Git-Url: https://git.sesse.net/?p=backup.sh;a=blobdiff_plain;f=backup.sh;h=a76baf99d8432b6d2dcac06d77b95ebf6d4bf568;hp=61ec0f5b365254fbe7973c62d187ad749fe3d5af;hb=0fd93f28df10578e1e485e6883b6b832daf245c5;hpb=b6bffb3924a05e6f37cc8f21db2c793c23c8ca25 diff --git a/backup.sh b/backup.sh index 61ec0f5..a76baf9 100755 --- a/backup.sh +++ b/backup.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # backup.sh # # Backup up Unix-like computers @@ -12,13 +12,13 @@ # mind when hacking: # # KISS. And by that I mean really simple. Only regular Unix commands, please -# (but GNU extensions are used). +# (but GNU extensions are used and moreutils has to be installed). # # Because of the way we run this script from cron, informational logging goes # to stderr and warnings and errors to stdout. This way, we get mail whenever # stuff fails, and other output is redirected to the log file. # -# The computers are backed up in parallell (but the filesystems on each +# The computers are backed up in parallel (but the filesystems on each # computer in serial). This is implemented highly simplistic, with forking # subshells. The script has no concept about threads, and stuff might go wrong, # which usually requires manual cleanups. @@ -113,14 +113,6 @@ backup() lastcmd="" fi - #if this client has a special tar - #we need to find a better solution to this conf-issue - if [ -f $confdir/tar.$computer ] ; then - tar=`cat $confdir/tar.$computer` - else - tar=tar - fi - # expand the exclude-path for use with tar exf=`ssh root@$computer "ls ~/.backup/exclude"` @@ -135,7 +127,7 @@ backup() # Pipe the stuff over ssh to ourselves, run pee to cat the contents to a # file and build a file list, respectivly. TARFILE=$DATE.tmp - TARCMD="ssh root@$computer \"$tar --one-file-system -zcf - -C $filesystem . $lastcmd \ + TARCMD="ssh root@$computer \"nice -n 19 ionice -c3 tar --one-file-system -zcf - -C $filesystem . $lastcmd \ --exclude-from=$exf\" | pee \"cat > $TARFILE\" \"tar tzvf -\"" echo `date`" $computer: Running $TARCMD" >&2 eval $TARCMD > $DATE.idx