p9p dumpvacroots

So my fossil has been needing rescue pretty much weekly nowadays. Thankfully i have it backed by venti, so it boild basically down to dumpvacroots and formatting fossil with the last vac in there (of course got to vacfs first to check...). The thing is that i use plan9ports venti from a linux machine, so dumpvacroots doesn't just work. I modified dumpvacroots to do work with p9p tools, i have used this for my venti, and works fine, may need some fine-tuning though (you probably need to change the ventihttp line to whatever your venti is listening on for http connections).

snip

 #!/usr/local/plan9/bin/rc
 # dumpvacroots - dumps all the vac scores ever stored to the venti server
 # if nothing else, this illustrates that you have to control access
 # to the physical disks storing the archive!

 ventihttp=`{
    echo $venti | 9 sed 's/^[a-z]+!([0-9\.]+)![a-z0-9]+$/\1/
        s/^[a-z]+!([0-9\.]+)/\1/; s/$/:8082/'
 }
 echo $ventihttp
 hget http://$ventihttp/index |
    9 awk '
        /^index=/ { blockSize = 0 + substr($3, 11) }
        /^arena=/ { arena = substr($1, 7) }
        /^  arena=/ {
            start = (0 + substr($5, 2)) - blockSize
            printf("venti/printarena -o %.0f %s\n", start, $3 "")
        }
    ' |
    rc |
    9 awk '$3 == 16 { printf("vac:%s\n", $2) }'