X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=backup%2Fold-increm;fp=backup%2Fold-increm;h=b036b89cf74d89bdcc7c8146cfb5938ee66964ee;hb=3f7f507605d77ece782e847a5a1606197268f220;hp=0000000000000000000000000000000000000000;hpb=1271e95c26179089358f4881398cb57811608b22;p=chiark-utils.git diff --git a/backup/old-increm b/backup/old-increm new file mode 100755 index 0000000..b036b89 --- /dev/null +++ b/backup/old-increm @@ -0,0 +1,58 @@ +#!/bin/sh + +set -e +false +dir=/var/local/backup +device=/dev/sda4 +blocksize=2048 +filesystems=all + +cd $dir +PATH=/usr/local/lib/backup:$PATH export PATH + +echo "FAILED during startup of incremental" >this-status + +timestamp='.' +for tsfs in `cat all-fsys-n` +do + echo "Checking timestamp of last full dump of $tsfs;" + if ! test "lfull.$timestamp" -ot "lfull.$tsfs" + then + timestamp="$tsfs" + fi +done + +if test -f "lfull.$timestamp" +then + echo "Using timestamp of last full dump of $timestamp." +else + echo >&2 "No full dump of $timestamp done yet." + exit 1 +fi + +rm -f this-fulldump +since="`cat lfull.$timestamp`" +doing="incremental since dump of $timestamp at `cat lfull.$timestamp` to $device" + +>increm-log +chmod 660 increm-log + +echo Doing "$doing" ... +echo "$doing": >>increm-log +cat fsys.all +echo "tar -lvvc \"-N$since\" -T$dir/fsys.all -f - \\" +echo " 2>>increm-log | dd of=$device bs=${blocksize}b" +echo "FAILED during incremental" >this-status +cd / +tar -lvvc "-N$since" -T$dir/fsys.all -f - 2>>$dir/increm-log \ + | dd of=$device bs=${blocksize}b +cd $dir + +echo "FAILED during cleanup" >this-status + +test -f this-fulldump && mv this-fulldump "lfull.$filesystems" +echo "$doing" completed. + +echo "Next dump tape to use would be `cat next-full`". + +echo "INCREMENTAL successful" >this-status