dumpvacroots 609 B

123456789101112131415161718192021
  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=`{
  6. echo $venti | sed 's/^[a-z]+!([0-9\.]+)![a-z0-9]+$/\1/
  7. s/^[a-z]+!([0-9\.]+)/\1/; s/$/:8000/'
  8. }
  9. hget http://$ventihttp/index |
  10. awk '
  11. /^index=/ { blockSize = 0 + substr($3, 11) }
  12. /^arena=/ { arena = substr($1, 7) }
  13. /^ arena=/ {
  14. start = (0 + substr($5, 2)) - blockSize
  15. printf("venti/printarena -o %.0f %s\n", start, $3 "")
  16. }
  17. ' |
  18. rc |
  19. awk '$3 == 16 { printf("vac:%s\n", $2) }'