From: ianmdlvl Date: Sun, 30 Jul 2006 19:04:43 +0000 (+0000) Subject: fixes from tests before big run X-Git-Tag: debian_version_4_1_3 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_1_3;ds=sidebyside fixes from tests before big run --- diff --git a/backup/snaprsync b/backup/snaprsync index 3238f39..3e3391f 100755 --- a/backup/snaprsync +++ b/backup/snaprsync @@ -1,7 +1,7 @@ #!/bin/bash # # usage: snaprsync ... -# is ---= +# is --= # are assigned to unused mandatory values in order # mandatory: # rhost device mountpoint localarea @@ -12,6 +12,7 @@ retcdir=/etc/chiark-backup rvardir=/var/lib/chiark-backup bwlimit= + subdir=. set -e @@ -27,7 +28,8 @@ while true; do value=${1#--*=} case "$name" in rhost|device|mountpoint|localarea);; - localprevious|rsharedir|retcdir|rvardir|bwlimit);; + localprevious|snapkind|rsharedir|retcdir|rvardir|bwlimit);; + subdir);; *) badusage "unknown setting $name";; esac eval "$name=\$value" @@ -71,6 +73,13 @@ mkfifo -m 600 $td/sentinel exec 4<>$td/sentinel x ssh $rhost "$sshpfx $rsharedir/snap-drop" +ssh $rhost " + $sshpfx + set -e + cd $rvardir + echo '$retcdir/snap/$snapkind drop $rvardir' >snap-drop.new + mv snap-drop.new snap-drop +" x ssh $rhost "$sshpfx $retcdir/snap/$snapkind snap $rvardir $device $mountpoint" ssh $rhost <$td/sentinel 4<&- " $sshpfx @@ -89,12 +98,12 @@ ssh $rhost <$td/sentinel 4<&- " xspawned rsum x $rsync -aHSxz --numeric-ids --delete \ ${localprevious:+--link-dest} $localprevious \ - $rhost:$rvardir/snap-mount/. $localarea/. + $rhost:$rvardir/snap-mount/$subdir $localarea/. date -u "+ $datefmt rsyncdone" exec 3>$localarea,lsums (cd $localarea && \ - $summer .) & + $summer . >&3) & xspawned lsum exec 3>&- diff --git a/debian/changelog b/debian/changelog index 70ece9a..e62b38e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,7 +6,12 @@ chiark-utils (4.1.3) unstable; urgency=low * Restrict copy to same file system (oops!). * Nicer messages from remountrocp (-q to mkfs; various echoes). - -- + backup snaprsync fixes: + * Support --subdir= option, defaults to `.' (root of source fs). + * Correctly set up /var/lib/chiark-backup/snap-drop so drop works. + * Send output of local summer to fd 3 as required. + + -- Ian Jackson Sun, 30 Jul 2006 15:41:07 +0100 chiark-utils (4.1.2) unstable; urgency=low