63 lines · 1.3 KB · Text
RawDownload
#!/bin/rc# backuparenas dev name ... - dump arena `name' from $fs to blu-ray disc.#	assumes $set is set.rfork ne# tunable variablesfs=pie if (test -e /sys/lib/backup/funcs)	.   /sys/lib/backup/funcs exits=''fsroot=/n/$fsif (! test -e $fsroot/!THIS_IS_^`{echo $fs | tr a-z A-Z}^_MAIN) {	import $fs / $fsroot || exit}unmount /mnt/cd >[2]/dev/nullcdfs -d $1 || exitshift done=noecho -n figuring out disc type...for (i in `{seq 1 20})	if (~ $done no) {		m=`{ls -l /mnt/cd | grep bd-r-dl}		if (~ $m '' ()) {			echo -n .			sleep 3		}		if not			done=yes	}echo ls -l /mnt/cdgrep next /mnt/cd/ctlecho -n 'nwa ok? 'ok=`{read}if (! ~ $ok [Yy]*)	exit bad-nwa cd $fsroot/dev/fsshname = `{basename $arenas}if (! test -r $shname){	echo $0: $shname in `{pwd} not readable >[1=2]	exit unreadable-arenas} for (name) {	grep next /mnt/cd/ctl	# use -o 8192 to avoid devmnt fragmentation if bd drive is imported	venti/rdarena $shname $name |		pump -i 65536 -o 8192 -k 100000 -d 5 >/mnt/cd/wd/$name#		pump -i 65536 -o 1048576 -k 51200 -d 10 >/mnt/cd/wd/$name	quitonfailure $status #	ls -l /mnt/cd	if (test -e '/env/fn#dumpdone' -a -e '/env/set')		dumpdone $shname $name}echo 'remember to *not* remove /mnt/cd/wd' >[1=2]# don't remove /mnt/cd/wd, since that would finalize the disc# and bugger the permanent toc, at least on bd-r.exit ''