dumpvacroots 571 B

12345678910111213141516171819
  1. #!/bin/rc
  2. # dumpvacroots - dumps all the vac scores ever stored to the venti server
  3. # if nothing else, this illustrates that you have to control access
  4. # to the physical disks storing the archive!
  5. ventihttp=`{echo $venti | sed 's/^[a-z]+!([0-9\.]+)![a-z0-9]+$/\1/
  6. s/^[a-z]+!([0-9\.]+)/\1/; s/$/:80/'
  7. }
  8. hget http://$ventihttp/index |
  9. awk '
  10. /^index=/ { blockSize=0+substr($3, 11) }
  11. /^arena=/ { arena=substr($1, 7) }
  12. /^ arena=/ {
  13. start = (0+substr($5, 2))-blockSize
  14. printf("venti/printarena -o %.0f %s\n", start, $3 "")
  15. }' |
  16. rc |
  17. sed -n 's/^(.*) 1$/vac:\1/p'