backuparenas 795 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/rc
  2. # backuparenas dev name ... - dump arena `name' from $fs to blu-ray disc.
  3. # assumes $set is set.
  4. rfork ne
  5. # tunable variables
  6. fs=yoshimi
  7. if (test -e /sys/lib/backup/funcs)
  8. . /sys/lib/backup/funcs
  9. exits=''
  10. fsroot=/n/$fs
  11. if (! test -e $fsroot/!THIS_IS_^`{echo $fs | tr a-z A-Z}^_MAIN) {
  12. import $fs / $fsroot || exit
  13. }
  14. unmount /mnt/cd >[2]/dev/null
  15. cdfs -d $1 || exit
  16. shift
  17. cd $fsroot/dev/fs
  18. for (name) {
  19. grep next /mnt/cd/ctl
  20. if (! {venti/rdarena arena0 $name |
  21. pump -b 65536 -k 51200 >/mnt/cd/wd/$name})
  22. exit
  23. ls -l /mnt/cd
  24. if (test -e '/env/fn#dumpdone' -a -e '/env/set')
  25. dumpdone arena0 $name
  26. }
  27. echo 'remember to *not* remove /mnt/cd/wd' >[1=2]
  28. # don't remove /mnt/cd/wd, since that would finalize the disc
  29. # and bugger the permanent toc, at least on bd-r.
  30. exit ''