chiark / gitweb /
from lalonde
[chiark-utils.git] / backup / increm
index b3c1f7019d57e2dd42feeb1fea506ecab926c2c0..e3037e8068e10617447b20ddeb18e00f64d795dd 100755 (executable)
@@ -90,10 +90,23 @@ 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') {
+
+    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 +114,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