chiark / gitweb /
@@ -1,8 +1,17 @@ debian_version_4_0_99_0_3
authorianmdlvl <ianmdlvl>
Sun, 21 Sep 2003 22:32:33 +0000 (22:32 +0000)
committerianmdlvl <ianmdlvl>
Sun, 21 Sep 2003 22:32:33 +0000 (22:32 +0000)
+chiark-utils (4.0.99.0.3) unstable; urgency=low
+
+  * use -m600 when creating named pipe
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk>  Sun, 21 Sep 2003 23:31:39 +0100
+
 chiark-utils (4.0.99.0.2) unstable; urgency=low

   * ship snap-drop
+  * don't mind devices on local filesystems (was failed stat bug)
+  * snap bugfixes
+  * use dump label

- --
+ -- Ian Jackson <ian@davenant.greenend.org.uk>  Sun, 21 Sep 2003 23:06:00 +0100

 chiark-utils (4.0.99.0.1) unstable; urgency=low

backup/Makefile
backup/backuplib.pl
backup/full
backup/increm
backup/iwjbackup.txt
backup/lvm
backup/snap-drop
debian/changelog
debian/chiark-backup/conffiles [new file with mode: 0644]
debian/rules

index a8c767e14b12b97a1e964ff8a64a131ac035e98e..6dfb904c964e9f27ca0d86aa872bdbdf8e9e5359 100644 (file)
@@ -25,9 +25,8 @@ us=   chiark-backup
 
 include ../settings.make
 
-BINSCRIPTS=    checkallused loaded driver takedown whatsthis labeltape \
-               snap-drop
-SHARESCRIPTS=  bringup full increm
+BINSCRIPTS=    checkallused loaded driver takedown whatsthis labeltape
+SHARESCRIPTS=  bringup full increm snap-drop
 SHAREFILES=    backuplib.pl
 SNAPKINDS=     lvm remount
 
@@ -42,7 +41,10 @@ install:             all
                        $(INSTALL_SCRIPT) $$s $(bindir)/backup-$$s; done
                $(INSTALL_SHARE) $(SHAREFILES) $(sharedir)
                $(INSTALL_SCRIPT) $(SHARESCRIPTS) $(sharedir)
-               $(INSTALL_SCRIPT) $(SNAPKINDS) $(confdir)/snap
+               set -e; for s in $(SNAPKINDS); do \
+                       d=$(confdir)/snap/$$s; \
+                       test ! -f $$d || d=$$d.dist; \
+                       $(INSTALL_SCRIPT) $$s $$d; done
 
 install-docs:
                $(INSTALL_DIRECTORY) $(txtdocdir)
index ddeb5bbb4bd9b9243b80c33403fdd0223d732f1b..b537f2ff7544874d6693141f8f851cf7630d305f 100644 (file)
@@ -173,8 +173,6 @@ sub parsefsys () {
        $dopts= $3;
        $prefix= '<local>';
        $pcstr= '';
-       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+)$#) {
         # Line of form '[/device:]/file/system dumptype[,options] prefix'
@@ -197,11 +195,16 @@ sub parsefsys () {
 
     $dev = $atf =~ s,^(.*)\:,, ? $1 : '';
 
+    if (!length $pcstr) {
+       stat $atf or die "stat $atf: $!";
+       -d _ or die "not a dir: $atf";
+    }
+
     undef %dopt;
     foreach $dopt (split /\,/,$dopts) {
        if (grep { $dopt eq $_ } qw(gz)) {
            $dopt{$dopt}= 'y';
-       if (grep { $dopt eq $_ } qw(snap)) {
+       } elsif (grep { $dopt eq $_ } qw(snap)) {
            $dopt{$dopt}= $dopt;
        } elsif ($dopt =~ m/\=/ && grep { $` eq $_ } qw(gz snap)) {
            $dopt{$`}= $';
@@ -222,6 +225,10 @@ sub parsefsys () {
            $$gzo= '';
        }
     }
+
+    if (length $dopt{'snap'}) {
+       length $dev or die "$pcstr:$atf no device but needed for snap";
+    }
 }
 
 sub execute ($) {
@@ -230,14 +237,19 @@ sub execute ($) {
 }
 
 sub prepfsys () {
+    $dev_print= $dev;
+    $atf_print= $atf;
+    
     if (length $dopt{'snap'}) {
+       
        system('snap-drop'); $? and die $?;
        
        $snapscripts= '/etc/chiark-backup/snap';
-       $snapbase= "$rstr $snapscripts/$dopt{'snap'} /var/lib/chiark-backup";
+       $snapbase= "$rstr $snapscripts/$dopt{'snap'}";
+       $snapargs= "/var/lib/chiark-backup";
 
-       $snapsnap= "$snapbase snap $dev $atf";
-       $snapdrop= "$snapbase drop";
+       $snapsnap= "$snapbase snap $snapargs $dev $atf";
+       $snapdrop= "$snapbase drop $snapargs";
 
        open SD, ">snap-drop.new" or die $!;
        print SD $snapdrop,"\n" or die $!;
index d4e5fcacd226599b8881c9abc48d41b89b51ea15..fffbb1ace16bb2dd2cbf30342e0bbf543ef9ac45 100755 (executable)
@@ -161,7 +161,7 @@ unlink 'this-md5sums';
 print "Doing $doing ...\n" or die $!;
 
 unlink 'p';
-system 'mknod p p'; $? and die $?;
+system 'mknod -m600 p p'; $? and die $?;
 
 setstatus "FAILED during dump";
 
@@ -204,12 +204,13 @@ for $tf (@fsys) {
        $ddcmd .= " conv=sync";
     }
     
-    nexttapefile("full $prefix:$atf");
+    nexttapefile("full $prefix:$atf_print");
 
     # We can back up via dump or cpio or zafio
     $dumpin= '</dev/null';
     if ($tm eq 'dump') {
-       $dumpcmd= "dump 0bfu $softblocksizekb - $atf";
+       $dumplabel= $pcstr.$atf_print.'$';
+       $dumpcmd= "dump 0Lbfu $dumplabel $softblocksizekb - $atf";
     } elsif ($tm eq 'cpio') {
        startprocess '</dev/null','>&FINDOW',$rstr."find $atf -xdev -noleaf -print0";
        $dumpcmd= "cpio -Hustar -o0C$softblocksizebytes";
@@ -226,7 +227,7 @@ for $tf (@fsys) {
        execute("$rstr touch $fsidfile+new");
        $dumpcmd= "tar Ccfl $atf - .";
     } else {
-       die "unknown method $tm for $prefix:$atf\n";
+       die "unknown method $tm for $prefix:$atf_print\n";
     }
     # This is a funky way of doing a pipeline which pays attention
     # to the exit status of all the commands in the pipeline.
index b50f50e8c9040d93475a1e8b8edcd455ca2f100a..945bb0e5dec5118b1e561be5a5f6fdb62b9da61a 100755 (executable)
@@ -104,15 +104,16 @@ for $tf (@fsys) {
     }
 
     if ($tm eq 'dump') {
-       $dumpcmd= "dump 1bfu $softblocksizekb - $atf";
+       $dumplabel= $pcstr.$atf_print.'$';
+       $dumpcmd= "dump 1Lbfu $dumplabel $softblocksizekb - $atf";
     } elsif ($tm eq 'gtar') {
        $dumpcmd= "tar NCcfl $fsidfile $atf - .";
     } else {
-       pboth("Not dumping $atf ($prefix) - not supported.\n");
+       pboth("Not dumping $atf_print ($prefix) - not supported.\n");
        next;
     }
 
-    nexttapefile("inc $prefix:$atf");
+    nexttapefile("inc $prefix:$atf_print");
     
     # Same trick as full uses to do a pipeline whilst keeping track
     # of all exit statuses:
@@ -139,8 +140,7 @@ print IAN "$advance\n" or die $!;
 close IAN or die $!;
 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 $!;
+pboth("Next FULL dump tape is $next\n");
 
 setstatus "INCREMENTAL successful: $tapedesc, next full is $next";
 exit 0;
index 775e65aa2e2ffc44f2e48567a88a91cd579c9dbf..5362fd1343b1978504e54af1d7fdb0599e2d824e 100644 (file)
@@ -94,6 +94,7 @@ Options supported:
     Indicates that the filesystem should be frozen before the backup
     by using /etc/chiark-backup/snap/<snapkind>.  See the head comment
     in /etc/chiark-backup/snap/lvm for details of how this works.
+    When snap= is used, the block device must be specified.
 
 expected-diffs is a config file to indicate which 
 filesystems should *not* be backed up. The scripts do a config
index 3e9cc2b74b6bb931feaca5fa6275d76d41206004..592513a6b5628e82659970d519317fc7189affbf 100755 (executable)
@@ -35,6 +35,7 @@ esac
 
 #---------- clean up anything
 
+snmnt="$vardir/snap-mount"
 umount -v "$snmnt" || true
 test ! -d "$snmnt" || rmdir -- "$snmnt"
 
index 39deaf16679b663a0af203c2ba1b51a08b3c636e..e3acf7f02d39580f766bc1f1eeec262d305756bb 100755 (executable)
@@ -2,6 +2,6 @@
 set -e
 vd=/var/lib/chiark-backup
 cd "$vd"
-test -f snap-drop
+test -f snap-drop || exit 0
 sh -x snap-drop || true
 rm snap-drop
index cb5c1ce4ee5f6282876ae53dfe90f63befd602b4..1a7c5ac45d760a61b6465ecb5f7c114727eb98df 100644 (file)
@@ -1,8 +1,17 @@
+chiark-utils (4.0.99.0.3) unstable; urgency=low
+
+  * use -m600 when creating named pipe
+
+ -- Ian Jackson <ian@davenant.greenend.org.uk>  Sun, 21 Sep 2003 23:31:39 +0100
+
 chiark-utils (4.0.99.0.2) unstable; urgency=low
 
   * ship snap-drop
+  * don't mind devices on local filesystems (was failed stat bug)
+  * snap bugfixes
+  * use dump label
 
- --
+ -- Ian Jackson <ian@davenant.greenend.org.uk>  Sun, 21 Sep 2003 23:06:00 +0100
 
 chiark-utils (4.0.99.0.1) unstable; urgency=low
 
diff --git a/debian/chiark-backup/conffiles b/debian/chiark-backup/conffiles
new file mode 100644 (file)
index 0000000..83e926d
--- /dev/null
@@ -0,0 +1,3 @@
+/etc/chiark-backup/settings.sh
+/etc/chiark-backup/snap/lvm
+/etc/chiark-backup/snap/remount
index 1733dcd8a95a92017d8938f044b088b1ca234610..30a80f09fb3ef9defb7bb96c8ecd902e9141f45d 100755 (executable)
@@ -66,6 +66,9 @@ binary-prep:
                for m in *.1; do \
                        mv "$$m" backup-"$$m"; \
                done
+       cp \
+ $t/chiark-backup/usr/share/doc/chiark-backup/examples/chiark/settings.sh \
+ $t/chiark-backup/etc/chiark-backup/settings.sh
        #
        install -d $t/chiark-really/usr/sbin
        install -d $t/chiark-really/usr/share/man/man8