[Veritas-bu] bpduplicate tape selection question
2004-05-12 15:32:13
Subject: |
[Veritas-bu] bpduplicate tape selection question |
From: |
kastus AT epocrates DOT com (Konstantin 'Kastus' Shchuka) |
Date: |
Wed, 12 May 2004 12:32:13 -0700 |
On Wed, May 12, 2004 at 12:12:21PM -0700, Ben Rockwood wrote:
> Hello.
>
> I'm working on building some offsite duplication scripts and
> methodologies. I'm hitting alittle hitch though. I can't see how to
> get bpduplicate to report which tape it selects for the duplication.
> Currently, I tell it to use a tape out of the duplication pool (I'm just
> using the default NB_Duplicate pool name) without specifying exactly
> which tape to use... the idea is that I don't need to update the
> duplication scripts daily/weekly with the tape id, I can just keep the
> duplication pool full of tapes.
I'm using the same approach of keeping a pool of tapes.
> But once the dup is done I can't find a
> way of automating the discovery of which tape it used in order to eject
> it. I can visually scan the medialist and tell which one it used, but I
> wouldn't want to script that method because it is inherently error prone.
> Is there anyway for bpduplicate to output the tape it used? Or should I
> just invoke this thing manually.
I keep a copy of backup ids from bpduplicate command and then use a script
to find which tapes contain second copy of those backups.
bpduplicate is invoked as follows:
$BPDUPLICATE -dstunit $DSTUNIT -v -Bidfile $BIDLISTFILE -dp $POOL -L $BPDUPLOG
As bpduplicate deletes Bidfile, I create a second copy of $BIDLISTFILE
before executing bpduplicate.
After running bpduplicate I call
MEDIA=$(cat $BIDLISTFILESAVE | $MEDIALIST)
where MEDIALIST is the following script:
----------------------------------------------------------------
#!/usr/bin/perl
# find media ids where copies were written
#
while (<>) {
open BPMEDIALIST, "/usr/openv/netbackup/bin/admincmd/bpimagelist -l -bac
kupid $_ |";
while (<BPMEDIALIST>) {
split ;
$media{$_[8]} ++ if $_[0] eq 'FRAG' && $_[1] == 2 ;
}
close BPMEDIALIST;
}
foreach $evsn ( sort keys %media ) {
print "$evsn ";
}
----------------------------------------------------------------
>
> A little followup question... when doing offsites is it worthwhile/wise
> to put a NB catalog backup on the offsite tape too?
I'm doing that. It takes an extra tape but in case you have to restore
everything from scratch, it helps.
Regards,
--
Konstantin 'Kastus' Shchuka
Unix System Administrator
ePocrates Inc.
tel 650.227.1786
fax 650.592.6995
|
|
|