#!/bin/rc # from arena partition to running venti (dst) # need running httpd venti (src) rfork en venti=127.0.0.1 host=tcp!127.0.0.1!1111 hget http://$venti:8000/index >index if(! ~ $status ''){ echo unable to get index >[1=2] exit } . info fn x { arena=$1 fileoffset=$2 arenapart=$3 clumpoffset=$arena if(~ $#$clumpoffset 0) $clumpoffset=0 echo venti/wrarena -h $host -o $fileoffset $arenapart $$clumpoffset end=`{venti/wrarena -h $host -o $fileoffset $arenapart $$clumpoffset | grep '^end offset ' | sed 's/^end offset //'} if(! ~ $status '') exit if(~ $#end 1 && ! ~ $$clumpoffset $end){ $clumpoffset=$end echo '#' `{date} >>info whatis $clumpoffset >>info } } cat index | awk ' /^index=/ { blockSize=0+substr($3, 11); } /^arena=/ { arena=substr($1, 7); } /^ arena=/ { fileoffset=0+substr($5, 2)-blockSize; printf("x %s %s %s\n", arena, fileoffset, $3); } ' |rc >log >[2=1]