backuparenas 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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=pie
  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. grep next /mnt/cd/ctl
  18. echo -n 'nwa ok? '
  19. ok=`{read}
  20. if (! ~ $ok [Yy]*)
  21. exit bad-nwa
  22. cd $fsroot/dev/fs
  23. for (name) {
  24. grep next /mnt/cd/ctl
  25. # use -o 8192 to avoid devmnt fragmentation if bd drive is imported
  26. venti/rdarena arena0 $name |
  27. pump -i 65536 -o 8192 -k 100000 -d 5 >/mnt/cd/wd/$name
  28. # pump -i 65536 -o 1048576 -k 51200 -d 10 >/mnt/cd/wd/$name
  29. quitonfailure $status
  30. # ls -l /mnt/cd
  31. if (test -e '/env/fn#dumpdone' -a -e '/env/set')
  32. dumpdone arena0 $name
  33. }
  34. echo 'remember to *not* remove /mnt/cd/wd' >[1=2]
  35. # don't remove /mnt/cd/wd, since that would finalize the disc
  36. # and bugger the permanent toc, at least on bd-r.
  37. exit ''