X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=blobdiff_plain;f=backup%2Fincrem;fp=backup%2Fincrem;h=f2cb7b4814b30e8b4ffaddfe9e6f1a7272c552b1;hp=bc058f7f7ffe0f44c1bf0300eb92696448f5382b;hb=b3fd532022de16d551780c987dac77cc5fd700f3;hpb=314a202a6f4e0a120fd982ad0398cdf507d6219d diff --git a/backup/increm b/backup/increm index bc058f7..f2cb7b4 100755 --- a/backup/increm +++ b/backup/increm @@ -61,22 +61,22 @@ close A or die $!; # better be a decimal number $advance =~ m/^\d+$/ or die "$advance ?"; +# Get a list of all filesystems +readfsys('all'); +openlog(); + # Rewind the tape and if we are the first incremental on the tape then # write the TAPEID record, otherwise skip forward to the correct point. # (full will already have checked that this is the right tape before # it invoked us, so no need to read the existing TAPEID record first.) -system "mt -f $ntape rewind"; $? and die $?; +runsystem("mt -f $ntape rewind"); if ($advance == 1) { writetapeid($tapeid,$tapedesc); } else { - system "mt -f $ntape fsf $advance"; $? and die $?; - $currenttapefilenumber= $advance+1; + runsystem("mt -f $ntape fsf $advance"); + $currenttapefilenumber= $advance; } -# Get a list of all filesystems -readfsys('all'); -openlog(); - sub closepipes () { close(DUMPOR); close(BUFOR); close(DUMPOW); close(BUFOW); @@ -128,7 +128,7 @@ for $tf (@fsys) { } # Rewind the tape, and increment the counter of incremental backups. -system "mt -f $tape rewind"; $? and die $?; +runsystem("mt -f $tape rewind"); open IAN,">increm-advance.new" or die $!; print IAN "$advance\n" or die $!; close IAN or die $!;