X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=backup.sh;h=12b210ac5bd6cbc6a734f98b79e058e899651e8c;hb=4ff9672fb8614ad8e39ada750d8a3baa8a98b944;hp=a16ca3fb3e65512b35c587a585cab4f7f2da4a53;hpb=f1670fd84567e1d18562c5f4f5309043ab5070e5;p=backup.sh diff --git a/backup.sh b/backup.sh index a16ca3f..12b210a 100755 --- a/backup.sh +++ b/backup.sh @@ -25,10 +25,14 @@ # # The script is halfway Norwegian and halfway English. Newer modifications are # in English, we should probably stick to that. - -# TODO(sesse, 2007-12-16): -# * Sjekk hvorfor .idx-filene til UD er blitt 0 for siste fullbackuper -# * Rydde uleselig kode fra linje 211 og litt nedover +# +# Known issues: +# +# o $R has no proper meaning because of the forking subshell stuff. We need a +# more robust way of returning non-zero on errors, which we probably don't +# right now. +# o The code around line 211 and downwards is messy. +# # Configuration LOCKFILE=/home/backup/backuprun.lockfile @@ -129,7 +133,7 @@ backup() # file and build a file list, respectivly. TARFILE=$DATE.tmp TARCMD="ssh root@$computer \"$tar --one-file-system -zcf - -C $filesystem . $lastcmd \ - --exclude-from=$exf\" | pee \"cat > $TARFILE\" \"tar tvf -\"" + --exclude-from=$exf\" | pee \"cat > $TARFILE\" \"tar tzvf -\"" echo `date`" $computer: Running $TARCMD" >&2 eval $TARCMD > $DATE.idx @@ -142,8 +146,8 @@ backup() # Update timestamp echo $DATEs > ../.date && touch -t $DATE ../.date - # Make a sorted filelist - grep -v ^d $DATE.idx | sort -n -r -k 2 > $DATE.sdx + # Make a sorted filelist as well + sort -k6 < $DATE.sdx > $DATE.sdx # Fix permissions chmod 600 *tgz #only for us