From: ianmdlvl Date: Sun, 21 Sep 2003 19:39:23 +0000 (+0000) Subject: @@ -1,8 +1,9 @@ X-Git-Tag: debian_version_4_0_99_0_1 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=commitdiff_plain;h=refs%2Ftags%2Fdebian_version_4_0_99_0_1 @@ -1,8 +1,9 @@ chiark-utils (4.0.99.0.1) unstable; urgency=low * backup: new lvm/remount-ro snapshotting feature. + * backup: new gtar backup type - -- + -- Ian Jackson Sun, 21 Sep 2003 20:39:13 +0100 chiark-utils (4.0.0) unstable; urgency=medium --- diff --git a/backup/backuplib.pl b/backup/backuplib.pl index 1c6b64c..ddeb5bb 100644 --- a/backup/backuplib.pl +++ b/backup/backuplib.pl @@ -190,6 +190,11 @@ sub parsefsys () { die "fsys $tf ?"; } + $fsidstr= $pcstr.$atf; + $fsidstr =~ s/[,+]/+$&/g; + $fsidstr =~ s#/#,#g; + $fsidfile= "/var/lib/chiark-backup/incstamp,$fsidstr"; + $dev = $atf =~ s,^(.*)\:,, ? $1 : ''; undef %dopt; @@ -219,12 +224,17 @@ sub parsefsys () { } } +sub execute ($) { + pboth(" $_[0]\n"); + system $_[0]; $? and die "$_[0] $?"; +} + sub prepfsys () { if (length $dopt{'snap'}) { system('snap-drop'); $? and die $?; $snapscripts= '/etc/chiark-backup/snap'; - $snapbase= "$pcstr $snapscripts/$dopt{'snap'} /var/lib/chiark-backup"; + $snapbase= "$rstr $snapscripts/$dopt{'snap'} /var/lib/chiark-backup"; $snapsnap= "$snapbase snap $dev $atf"; $snapdrop= "$snapbase drop"; @@ -234,8 +244,7 @@ sub prepfsys () { close SD or die $!; rename "snap-drop.new","snap-drop" or die $!; - pboth(" $snapsnap\n"); - system $snapsnap; $? and die $?; + execute($snapsnap); $dev_nosnap= $dev; $atf_nosnap= $atf; diff --git a/backup/full b/backup/full index 9c603b9..d4e5fca 100755 --- a/backup/full +++ b/backup/full @@ -222,6 +222,9 @@ for $tf (@fsys) { $dumpin = '<&FINDOR'; } elsif ($tm eq 'ntfsimage') { $dumpcmd= "ntfsimage -svvf --dirty $dev"; + } elsif ($tm eq 'gtar') { + execute("$rstr touch $fsidfile+new"); + $dumpcmd= "tar Ccfl $atf - ."; } else { die "unknown method $tm for $prefix:$atf\n"; } @@ -251,6 +254,10 @@ for $tf (@fsys) { $totalrecords += $1; pboth("total blocks written so far: $totalrecords\n"); + if ($tm eq 'gtar') { + execute("$rstr mv -f $fsidfile+new $fsidfile"); + } + finfsys(); } diff --git a/backup/increm b/backup/increm index ac22095..b50f50e 100755 --- a/backup/increm +++ b/backup/increm @@ -105,9 +105,10 @@ for $tf (@fsys) { if ($tm eq 'dump') { $dumpcmd= "dump 1bfu $softblocksizekb - $atf"; + } elsif ($tm eq 'gtar') { + $dumpcmd= "tar NCcfl $fsidfile $atf - ."; } else { - print "Not dumping $atf ($prefix) - not \`dump'.\n" or die $!; - print LOG "Not dumping $atf ($prefix) - not \`dump'.\n" or die $!; + pboth("Not dumping $atf ($prefix) - not supported.\n"); next; } diff --git a/backup/iwjbackup.txt b/backup/iwjbackup.txt index 39000ee..775e65a 100644 --- a/backup/iwjbackup.txt +++ b/backup/iwjbackup.txt @@ -64,12 +64,21 @@ In the fsys.* files: The file (including any included files) must end with the word 'end' on a line of its own. -Valid values for are `cpio' (uses cpio to produce -tar-format backups), `dump' (uses dump to dump entire filesystems; - should be a mount-point for this), `zafio' (uses afio -to compress each file as it is backed up), and `ntfsimage' (for NTFS -volumes, requires device name). Only `dump' type backups perform -incremental backups. +Valid values for are + cpio + uses cpio to produce tar-format backups + dump + uses dump to dump entire filesystems + should be a mount-point + gtar + uses GNU tar to produce GNU tar format backups and -N-based + semi-incrementals (not --incremental or --listed-incremental) + zafio + uses afio to compress each file as it is backed up + ntfsimage + for NTFS volumes, requires device name +Only `dump' and `gtar' type backups perform any kind of incremental +backups. is a comma-separated list of