X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=blobdiff_plain;f=backup%2Ffull;h=fffbb1ace16bb2dd2cbf30342e0bbf543ef9ac45;hp=2f630eb1660bbf561df8c6d02c4b2b91eb20e487;hb=50fe60865662b13acaa1efcc49f1837fdffd785a;hpb=b3fd532022de16d551780c987dac77cc5fd700f3 diff --git a/backup/full b/backup/full index 2f630eb..fffbb1a 100755 --- a/backup/full +++ b/backup/full @@ -161,7 +161,7 @@ unlink 'this-md5sums'; print "Doing $doing ...\n" or die $!; unlink 'p'; -system 'mknod p p'; $? and die $?; +system 'mknod -m600 p p'; $? and die $?; setstatus "FAILED during dump"; @@ -186,6 +186,7 @@ foreach $exc (@excl) { for $tf (@fsys) { printdate(); parsefsys(); + prepfsys(); pipe(FINDOR,FINDOW) or die $!; pipe(DUMPOR,DUMPOW) or die $!; @@ -203,12 +204,13 @@ for $tf (@fsys) { $ddcmd .= " conv=sync"; } - nexttapefile("full $prefix:$atf"); + nexttapefile("full $prefix:$atf_print"); # We can back up via dump or cpio or zafio $dumpin= '&FINDOW',$rstr."find $atf -xdev -noleaf -print0"; $dumpcmd= "cpio -Hustar -o0C$softblocksizebytes"; @@ -220,9 +222,12 @@ for $tf (@fsys) { $dumpcmd = "afio -b $softblocksizebytes -Zo -"; $dumpin = '<&FINDOR'; } elsif ($tm eq 'ntfsimage') { - $dumpcmd= "ntfsimage -vvf --dirty $dev"; + $dumpcmd= "ntfsimage -svvf --dirty $dev"; + } elsif ($tm eq 'gtar') { + execute("$rstr touch $fsidfile+new"); + $dumpcmd= "tar Ccfl $atf - ."; } else { - die "unknown method $tm for $prefix:$atf\n"; + die "unknown method $tm for $prefix:$atf_print\n"; } # This is a funky way of doing a pipeline which pays attention # to the exit status of all the commands in the pipeline. @@ -249,6 +254,12 @@ for $tf (@fsys) { push @tapefilesizes, [ $1, $currenttapefilename ]; $totalrecords += $1; pboth("total blocks written so far: $totalrecords\n"); + + if ($tm eq 'gtar') { + execute("$rstr mv -f $fsidfile+new $fsidfile"); + } + + finfsys(); } # The backup should now be complete; verify it