chiark / gitweb /
As found on chiark in /usr/local/lib/backup: better tapeid/tapedesc handling; added... branchpoint-2001-10-07-from-pmaydell
authorianmdlvl <ianmdlvl>
Sun, 7 Oct 2001 16:28:16 +0000 (16:28 +0000)
committerianmdlvl <ianmdlvl>
Sun, 7 Oct 2001 16:28:16 +0000 (16:28 +0000)
backup/driver
backup/full
backup/increm

index 5060e2fb488c1d69c07f3a4a10a941b3645512f5..394b3fbf04e8d46465f4b8135a24bd8db0e1831b 100755 (executable)
@@ -16,7 +16,7 @@ full 2>&1 | tee this-log
 status=`cat this-status 2>/dev/null`
 
 cat <<END - this-log | /usr/lib/sendmail -oi -om -odq -t
-To: system-reports
+To: dump-reports
 Subject: Dump Report: $status
 
 END
index d3efa171894b752bb047f55049af0b6a47c3f7bb..0608e6095234da93eb529759efe88942c339bdb8 100755 (executable)
@@ -14,6 +14,7 @@ system 'checkallused'; $? and die $?;
 printdate();
 
 unlink 'TAPEID';
+system "mt -f $tape rewind"; $? and die $?;
 system "mt -f $tape setblk $blocksizebytes"; $? and die $?;
 system "dd if=$tape bs=${blocksize}b count=10 | tar -b$blocksize -vvxf - TAPEID";
 
@@ -42,6 +43,13 @@ if (open L, "last-tape") {
 
 die "Tape $tapeid same as last time.\n" if $tapeid eq $lasttape;
 
+if (defined($tapedesc= readlink "$etc/tape.$tapeid")) {
+    $tapedesc =~ s/^.*\.//;
+    $tapedesc .= "($tapeid)";
+} else {
+    $tapedesc = $tapeid;
+}
+
 undef $fsys;
 open D, "$etc/tape.$tapeid" or die "Unknown tape $tapeid ($!).\n";
 for (;;) {
@@ -66,21 +74,18 @@ if ($incremental) {
        if defined($next) || defined($fsys);
     print STDERR "Incremental tape $tapeid.\n\n";
     setstatus "FAILED during incremental startup";
-    exec "increm $tapeid";
+    exec "increm",$tapeid,$tapedesc;
     die $!;
 }
 
 readfsys("$fsys");
 openlog();
 
-$doing= "dump of $fsys to tape $tapeid in drive $tape";
+$doing= "dump of $fsys to tape $tapedesc in drive $tape";
 print LOG "$doing:\n" or die $!;
 
-system "mt -f $tape rewind"; $? and die $?;
-system "mt -f $tape retension"; $? and die $?;
-
 open T, ">TAPEID" or die $!;
-print T "$tapeid\n" or die $!;
+print T "$tapeid\n$tapedesc\n" or die $!;
 close T or die $!;
 
 system "tar -b$blocksize -vvcf TAPEID.tar TAPEID"; $? and die $?;
@@ -162,5 +167,5 @@ rename 'increm-advance.new',"increm-advance" or die $!;
 
 print "$doing completed.\nNext dump tape is $next.\n" or die $!;
 
-setstatus "Successful ($tapeid $fsys, next $next)";
+setstatus "Successful: $tapedesc $fsys, next $next";
 exit 0;
index e4ebbf75a5bf881886863164d6b61c14bc1945aa..1d2aaa774afe6633558af65fdd5665ae0ad25f59 100755 (executable)
@@ -8,10 +8,10 @@ BEGIN {
 
 $|=1;
 
-@ARGV==1 or die;
-$tapeid= $ARGV[0];
+@ARGV==2 or die;
+($tapeid,$tapedesc)= @ARGV;
 
-print "Running incremental (tape $tapeid) ...\n" or die $!;
+print "Running incremental onto $tapedesc ...\n" or die $!;
 
 open T,"$etc/tape.$tapeid" or die "Tape $tapeid not found: $!\n";
 close T;
@@ -28,12 +28,10 @@ close A or die $!;
 
 $advance =~ m/^\d+$/ or die "$advance ?";
 
-system "mt -f $tape rewind"; $? and die $?;
-system "mt -f $tape retension"; $? and die $?;
-
+system "mt -f $ntape rewind"; $? and die $?;
 if ($advance == 1) {
     open TI,">TAPEID" or die $!;
-    print TI "$tapeid" or die $!;
+    print TI "$tapeid\n$tapedesc\n" or die $!;
     close TI or die $!;
 
     system "tar -b$blocksize -vvcf TAPEID.tar TAPEID"; $? and die $?;
@@ -71,7 +69,6 @@ for $tf (@fsys) {
 }
 
 system "mt -f $tape rewind"; $? and die $?;
-
 open IAN,">increm-advance.new" or die $!;
 print IAN "$advance\n" or die $!;
 close IAN or die $!;
@@ -80,5 +77,5 @@ rename 'increm-advance.new','increm-advance' or die $!;
 print LOG "Next FULL dump tape is $next\n" or die $!;
 print "Next FULL dump tape is $next\n" or die $!;
 
-setstatus "INCREMENTAL successful (next full is $next)";
+setstatus "INCREMENTAL successful: $tapedesc, next full is $next";
 exit 0;