From: Robert Raschke <rrplan9@tombob.com>
To: 9fans@cse.psu.edu
Subject: [9fans] venti backup example vs. 2GB
Date: Mon, 25 Sep 2006 22:11:31 +0100 [thread overview]
Message-ID: <432bc0dde71c69a75de5f60bf55915ec@tombob.com> (raw)
Hi,
I've been using a backup script modelled on the example in
/sys/src/cmd/venti/backup.example and the other day it "just" stopped
working. On debugging I found that I have now reached the beginning
of the fifth 500MB arena. The script uses awk to calculate the
starting byte offset and that fails with a floating point error (!)
when we go beyond the 2G mark.
I resorted to a fairly brutal use of bc(1) and that seems to work.
Here's what I use now (I flipped the 2nd and 3rd parameter to the x fn
to make printing from bc easier):
#!/bin/rc
rfork e
. bkup.info
fn x {
echo x $*
y=$1
if(~ $#$y 0){
$y=0
}
echo venti/wrarena -h venti_backup_server -o $3 $2 $$y
end=`{venti/wrarena -h venti_backup_server -o $3 $2 $$y | grep '^end offset ' | sed 's/^end offset //'}
if(~ $#end 1 && ! ~ $$y $end){
$y=$end
echo '#' `{date} >>bkup.info
whatis $y >>bkup.info
}
}
hget http://127.1:8000/index |
awk '
/^index=/ { blockSize=0+substr($3, 11); }
/^arena=/ { arena=substr($1, 7); }
/^ arena=/ {
start=substr($5, 2, index($5, ",")-2);
printf("\"x \"; \"%s \"; \"%s \"; s=%s-%s; print s;", arena, $3, start, blockSize);
}
' |bc -s |rc
Robby
next reply other threads:[~2006-09-25 21:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-25 21:11 Robert Raschke [this message]
2006-09-25 21:28 ` geoff
2006-09-25 21:53 ` geoff
2006-09-26 0:09 ` erik quanstrom
2006-09-26 0:12 ` geoff
2006-09-26 0:18 ` erik quanstrom
2006-09-26 0:49 ` Russ Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=432bc0dde71c69a75de5f60bf55915ec@tombob.com \
--to=rrplan9@tombob.com \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).