$|=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();
$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.
-writetapeid($tapeid);
+writetapeid($tapeid,$tapedesc);
unlink 'this-md5sums';
pipe(FINDOR,FINDOW) or die $!;
pipe(DUMPOR,DUMPOW) or die $!;
pipe(TEEOR,TEEOW) or die $!;
+ $bufir='TEEOR';
+
+ if ($dopt{'gz'} eq 'y') {
+ $gz= '3';
+ } elsif ($dopt{'gz'} =~ m/^\d$/) {
+ $gz= $dopt{'gz'};
+ } elsif (defined $dopt{'gz'}) {
+ die "$tf bad gz";
+ } else {
+ $gz= 0;
+ }
+ if ($gz) {
+ $bufir='GZOR';
+ pipe(GZOR,GZOW) or die $!;
+ }
+
pipe(BUFOR,BUFOW) or die $!;
parsefsys();
startprocess '<p','>>this-md5sums','md5sum';
startprocess $dumpin,'>&DUMPOW',$rstr.$dumpcmd;
startprocess '<&DUMPOR','>&TEEOW','tee p';
- startprocess '<&TEEOR','>&BUFOW','writebuffer';
+ if ($gz) {
+ startprocess '<&TEEOR','>&GZOW','gzip -v$gz';
+ }
+ startprocess "<&$bufir",'>&BUFOW','writebuffer';
startprocess '<&BUFOR','>/dev/null'
,"dd ibs=$softblocksizebytes obs=$blocksizebytes of=$ntape";
closepipes();