The way I do this is to create a list of backupids on my disk storage unit.
bpimmedia -mediaid <disk_fs> | awk '$1=="IMAGE" {print $4}'
I then sort that list into sets and duplicate each set of backupid's with
bpduplicate's "-bidfile" options (make a copy of the bidfile for later
checks, bpduplicate has an "undocumented feature" where it deletes the
bidfile when done.
/usr/openv/netbackup/bin/admincmd/bpduplicate [-dstunit
destination_storage_unit_label] [-p | -pb | -PM | -PD] [-Bidfile
file_name] [-v] [-client name] [-st sched_type] [-sl sched_label]
[-L output_file] [-dp destination_pool_name] [-shost source_host]
[-class name] [-s mm/dd/yy hh:mm:ss] [-e mm/dd/yy hh:mm:ss] [-ct
class_type] [-hoursago hours] [-cn copy_number] [-M
master_server]
[-backupid backup_id] [-id media_id] [-mpx]
Once complete, the I check the list of backupids to make sure that each id
has been successfully duplicated (has a copy on media other than my disk
STU).
verifytape () {
# Function: Supply bpimageid, returns 0=not-on-tape, else n=copy on tape
image=$1
pattern=`echo "$DISK" | sed 's,\/,\\\/,g'`
copy=`bpimagelist -backupid $image|\
awk 'BEGIN {copy=0}
{if ($1=="FRAG" && $9!~/^'$pattern'/) {copy=$2}}
END {print copy}'`
echo $copy
return $copy
}
If the image is successfully duplicated, I expire the on-disk copy with
bpexpdate's "-backupid" option.
diskcopy () {
# Function: Supply bpimageid, returns 0=not-on-disk, else n=copy on disk
image=$1
pattern=`echo "$DISK" | sed 's,\/,\\\/,g'`
copy=`bpimagelist -backupid $image|\
awk 'BEGIN {copy=0}
{if ($1=="FRAG" && $9~/^'$pattern'/) {copy=$2}}
END {print copy}'`
echo $copy
return $copy
}
...and...
bpexpdate -d 0 -backupid <backupid> -force -copy <on_disk_copynum>
HTH -M
-----Original Message-----
From: Markham, Richard [mailto:RLMarkham AT hafeleamericas DOT com]
Sent: Wednesday, November 12, 2003 10:04 AM
To: 'veritas-bu AT mailman.eng.auburn DOT edu'
Subject: [Veritas-bu] images - disk storage unit & bpduplicate to tape
I am having trouble figuring out how to list backupid info for a given
server/schedule,
which would indicate number of copies and which one is currently the primary
copy. My
understanding is that if I want to expire my disk images (sometime after
duplication)
I would want to be certain to specify the -copy (copy number) and each
-backupid. I
should be able to accomplish this is which good report output.
bpimagelist -L -client <client> -sl <schedule> -d <start> -e <end> is in the
right
direction but the output is huge. I think basically what I am asking here
is if anyone
has any better method of expiring their disk images.
Netbackup Datacenter 3.4.2
Solaris 8
TIA
_______________________________________________
Veritas-bu maillist - Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
|