chiark / gitweb /
bugfixes
[chiark-utils.git] / backup / full
index 5d210af38fd18e5c6421a85cfcd20dd45189dbe7..784d302335e3c3653c6e484cab95fed8125281d4 100755 (executable)
@@ -30,12 +30,29 @@ BEGIN {
 
 $|=1;
 
+while (@ARGV) {
+    $_= shift @ARGV;
+    if (m/^\-\-no\-reten$/) {
+       $noreten=1;
+    } elsif (m/^\-\-no\-config\-check$/) {
+       $nocheck=1;
+    } else {
+       die "unknown option/argument \`$_'\n";
+    }
+}
+
 # Check to see whether the tape.nn and fsys.nn files are sane.
 # checkallused checks that all the filesystems mounted are in fact
 # dumped in both full and incremental dumps.
-setstatus "FAILED configuration check";
-print "Configuration check ...\n" or die $!;
-system 'backup-checkallused'; $? and die $?;
+
+if (!$nocheck) {
+    setstatus "FAILED configuration check";
+    print "Configuration check ...\n" or die $!;
+    system 'backup-checkallused'; $? and die $?;
+} else {
+    setstatus "FAILED rewinding";
+    rewind_raw();
+}
 
 printdate();
 
@@ -128,8 +145,10 @@ openlog();
 $doing= "dump of $fsys to tape $tapedesc in drive $tape";
 print LOG "$doing:\n" or die $!;
 
-setstatus "FAILED retensioning";
-system "mt -f $tape reten"; $? and die $?;
+if (!$noreten) {
+    setstatus "FAILED retensioning";
+    system "mt -f $tape reten"; $? and die $?;
+}
 
 setstatus "FAILED writing tape ID";
 # First write the tape ID to this tape.
@@ -213,7 +232,7 @@ for $tf (@fsys) {
     if ($gz) {
        startprocess '<&TEEOR','>&GZOW','gzip -v$gz';
     }
-    startprocess '<&$bufir','>&BUFOW','writebuffer';
+    startprocess "<&$bufir",'>&BUFOW','writebuffer';
     startprocess '<&BUFOR','>/dev/null'
        ,"dd ibs=$softblocksizebytes obs=$blocksizebytes of=$ntape";
     closepipes();