From c9864d70f390dc1e16c7f1d744f15a2a008f5ce8 Mon Sep 17 00:00:00 2001 From: ianmdlvl Date: Mon, 5 May 2003 16:39:52 +0000 Subject: [PATCH] bugfixes --- backup/backuplib.pl | 4 ++-- backup/full | 31 +++++++++++++++++++++++++------ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/backup/backuplib.pl b/backup/backuplib.pl index c2c7e81..279cbd6 100644 --- a/backup/backuplib.pl +++ b/backup/backuplib.pl @@ -141,7 +141,7 @@ sub readfsys ($) { # to be in $tf. sub parsefsys () { my ($dopts,$dopt); - if ($tf =~ m,^(/\S*)\s+(\w+)([,0-9a-z]+)$,) { + if ($tf =~ m#^(/\S*)\s+(\w+)([,0-9a-z]+)$#) { # Line of form '/file/system dumptype[,options]' $atf= $1; $tm= $2; @@ -150,7 +150,7 @@ sub parsefsys () { stat $atf or die "stat $atf: $!"; -d _ or die "not a dir: $atf"; $rstr= ''; - } elsif ($tf =~ m,^(/\S*)\s+(\w+)([,0-9a-z]+)\s+(\w+)$,) { + } elsif ($tf =~ m#^(/\S*)\s+(\w+)([,0-9a-z]+)\s+(\w+)$#) { # Line of form '/file/system dumptype[,options] prefix' # (used for remote backups) $atf= $1; diff --git a/backup/full b/backup/full index 5d210af..784d302 100755 --- a/backup/full +++ b/backup/full @@ -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(); -- 2.30.2