chiark
/
gitweb
/
~ian
/
chiark-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f163dbe
)
bugfixes
author
ianmdlvl
<ianmdlvl>
Mon, 5 May 2003 16:39:52 +0000
(16:39 +0000)
committer
ianmdlvl
<ianmdlvl>
Mon, 5 May 2003 16:39:52 +0000
(16:39 +0000)
backup/backuplib.pl
patch
|
blob
|
history
backup/full
patch
|
blob
|
history
diff --git
a/backup/backuplib.pl
b/backup/backuplib.pl
index c2c7e811ff6ab82e8b2ead83769d681de42d3db7..279cbd6ec0e782c2355df1693d841aa2794bf497 100644
(file)
--- a/
backup/backuplib.pl
+++ b/
backup/backuplib.pl
@@
-141,7
+141,7
@@
sub readfsys ($) {
# to be in $tf.
sub parsefsys () {
my ($dopts,$dopt);
# 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;
# 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= '';
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;
# Line of form '/file/system dumptype[,options] prefix'
# (used for remote backups)
$atf= $1;
diff --git
a/backup/full
b/backup/full
index 5d210af38fd18e5c6421a85cfcd20dd45189dbe7..784d302335e3c3653c6e484cab95fed8125281d4 100755
(executable)
--- a/
backup/full
+++ b/
backup/full
@@
-30,12
+30,29
@@
BEGIN {
$|=1;
$|=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.
# 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();
printdate();
@@
-128,8
+145,10
@@
openlog();
$doing= "dump of $fsys to tape $tapedesc in drive $tape";
print LOG "$doing:\n" or die $!;
$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.
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';
}
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();
startprocess '<&BUFOR','>/dev/null'
,"dd ibs=$softblocksizebytes obs=$blocksizebytes of=$ntape";
closepipes();