chiark / gitweb /
@@ -3,6 +3,7 @@
[chiark-utils.git] / backup / increm
index fc20b3a32b85e6ef49114cabdd337d2c8db70099..9bad0f1c6e3229b3cd2d4fdf53ff3f4c0e748408 100755 (executable)
@@ -28,7 +28,7 @@
 # includes ID and function).
 
 BEGIN {
-    $etc= '/etc/backup';
+    $etc= '/etc/chiark-backup';
     require "$etc/settings.pl";
     require 'backuplib.pl';
 }
@@ -90,10 +90,24 @@ setstatus "PROBLEMS during incremental dump";
 
 for $tf (@fsys) {
 
+    parsefsys();
+    
+    $bufir='DUMPOR';
+    $ddcmd= "$nasty dd ibs=$softblocksizebytes obs=$blocksizebytes of=$ntape";
+
     pipe(DUMPOR,DUMPOW) or die $!;
     pipe(BUFOR,BUFOW) or die $!;
-    parsefsys();
-    if ($tm ne 'dump') {
+
+    $gz= $gzi if length $gzi;
+    if ($gz) {
+       $bufir='GZOR';
+       pipe(GZOR,GZOW) or die $!;
+       $ddcmd .= " conv=sync";
+    }
+
+    if ($tm eq 'dump') {
+       $dumpcmd= "dump 1bfu $softblocksizekb - $atf";
+    } else {
        print "Not dumping $atf ($prefix) - not \`dump'.\n" or die $!;
        print LOG "Not dumping $atf ($prefix) - not \`dump'.\n" or die $!;
        next;
@@ -101,10 +115,12 @@ for $tf (@fsys) {
     # Same trick as full uses to do a pipeline whilst keeping track
     # of all exit statuses:
     #   dump </dev/null | writebuffer | dd >/dev/null
-    startprocess '</dev/null','>&DUMPOW',$rstr."dump 1bfu $softblocksizekb - $atf";
-    startprocess '<&DUMPOR','>&BUFOW','writebuffer';
-    startprocess '<&BUFOR','>/dev/null'
-       ,"dd ibs=$softblocksizebytes obs=$blocksizebytes of=$ntape";
+    startprocess '</dev/null','>&DUMPOW',"$nice ".$rstr.$dumpcmd;
+    if ($gz) {
+       startprocess '<&DUMPOR','>&GZOW',"$nice gzip -v$gz";
+    }
+    startprocess "<&$bufir",'>&BUFOW',"$nasty writebuffer";
+    startprocess '<&BUFOR','>/dev/null',"$nasty $ddcmd";
     closepipes();
     endprocesses();
     # advance is a file counter, so it needs to be updated for each