chiark / gitweb /
Get lookup result wrong. Err msgs clarified.
[chiark-utils.git] / backup / full
index 5e6d23e0f0231c062ece1830bb9b445da6f72855..668b5fdaec6fa9216e1ad1c7bcd1fe299261de2a 100755 (executable)
@@ -1,7 +1,29 @@
 #!/usr/bin/perl
+# full
+# Main backup script - does a full dump or execs increm.  Do NOT run directly!
+#
+# This file is part of chiark backup, a system for backing up GNU/Linux and
+# other UN*X-compatible machines, as used on chiark.greenend.org.uk.
+#
+# chiark backup is:
+#  Copyright (C) 1997-1998,2000-2001 Ian Jackson <ian@chiark.greenend.org.uk>
+#  Copyright (C) 1999 Peter Maydell <pmaydell@chiark.greenend.org.uk>
+#
+# This is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2, or (at your option) any later version.
+#
+# This is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 BEGIN {
-    $etc= '/etc/backup';
+    $etc= '/etc/chiark-backup';
     require "$etc/settings.pl";
     require 'backuplib.pl';
 }
@@ -13,16 +35,14 @@ $|=1;
 # dumped in both full and incremental dumps.
 setstatus "FAILED configuration check";
 print "Configuration check ...\n" or die $!;
-system 'checkallused'; $? and die $?;
+system 'backup-checkallused'; $? and die $?;
 
 printdate();
 
 setstatus "FAILED reading TAPEID";
 # Try to read the tape ID from the tape into the file TAPEID
-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";
+
+readtapeid_raw();
 
 setstatus "FAILED during startup";
 
@@ -108,14 +128,13 @@ 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 $?;
+
 setstatus "FAILED writing tape ID";
 # First write the tape ID to this tape.
-open T, ">TAPEID" or die $!;
-print T "$tapeid\n" or die $!;
-close T or die $!;
 
-system "tar -b$blocksize -vvcf TAPEID.tar TAPEID"; $? and die $?;
-system "dd if=TAPEID.tar of=$ntape bs=${blocksize}b count=10"; $? and die $?;
+writetapeid($tapeid);
 
 unlink 'this-md5sums';