Francisco wrote:
> We start the second venti server (the backup) just to update its
> arenas with those
> of the primary one. Also, we format a fossil on the backup machine so
> we could boot
> it upon failures of the primary.
> 
> All clients write to the primary file server (fossil) which has just
> one venti on its own
> machine. This is the venti backed up to our secondary venti (once per night).
> 

Yup, that's my approach as well.  I just start up a venti on my
(otherwise "diskless") terminal and then run a backup script on the
main server.  I got the backup script from somewhere Russ inspired,
but for the life of me cannot remember where exactly:

#!/bin/rc

rfork e
. bkup.info
fn x {
        echo x $*
        y=$1
        if(~ $#$y 0){
                $y=0
        }
        echo venti/wrarena -h other_venti_hostname -o $2 $3 $$y
        end=`{venti/wrarena -h other_venti_hostname -o $2 $3 $$y | grep '^end 
offset ' | sed 's/^end offset //'}
        if(~ $#end 1 && ! ~ $$y $end){
                $y=$end
                echo '#' `{date} >>bkup.info
                whatis $y >>bkup.info
        }
}
hget http://127.1:8000/index | 
awk '
/^index=/ { blockSize=0+substr($3, 11); }
/^arena=/ { arena=substr($1, 7); }
/^      arena=/ { start=0+substr($5, 2)-blockSize; printf("x %s %d %s\n", 
arena, start, $3); }
' |rc


This copies the latest blocks from your main venti to your running
backup one.  On the backup machine you can then do whatever you want
with the venti.  For example create yourself a fossil, and as long as
you make sure that fossil doesn't snap to the venti, you'll always
have a nice pristine copy of your original.

Robby

Reply via email to