I use
bpduplicate -pb -client <client> -s mm/dd/yyyy hh:mm:ss -e mm/dd/yyyy
hh:mm:ss
or
bpduplicate -pb -client <client> -hoursago ##
It will give you output like:
C:\>bpduplicate -pb -client MyClient -hoursago 24
Media id = 100967 Server = MediaServer1
Media id = 100848 Server = MediaServer1
Media id = 101128 Server = MediaServer2
The -pb option tells it to not actually do the dupe for the backup but will
list the tapes it would dupe. This of course means you only know all the
tapes that were used for the backup - not the specific tape the file you
wish to restore exist on. To find that out you can script something to go
through the .f image files in the \netbackup\db\imnages\<client>\<time>
folders for netbackup 3.4 - for 4.5 and greater that cannot be done (they
are now stored in binary format - but you can convert them if you want, they
just take up a bunch of space that way).
- Cuyler Dingwell
-----Original Message-----
From: veritas-bu-admin AT mailman.eng.auburn DOT edu
[mailto:veritas-bu-admin AT mailman.eng.auburn DOT edu] On Behalf Of Dan Logcher
Sent: April 2, 2004 9:45 AM
To: veritas-bu AT mailman.eng.auburn DOT edu
Subject: Re: [Veritas-bu] scriptable method to determine volumes needed for
a restore?
Donald_Arsenault AT bankone DOT com wrote:
>
> Use:
>
> bpimagelist -U -d mm/dd/yyyy hh:mm:ss -e mm/dd/yyyy hh:mm:ss -client
> <name> -media
I wrote this perl script to tell me which tapes to pull for offsiting, but
it will work for this as well. Give it a try and let me know what you
think.
#!/usr/local/bin/perl
require "getopts.pl";
foreach (@ARGV) {
$args=join(' ',$args,$_);
$args=~s/^ //g;
$args=~s/(.*[0-9]) ([0-9])/$1.$2/g;
}
@ARGV=split(/ /,$args);
do Getopts('c:a,s:b,e:c,t');
$bpm="/usr/openv/netbackup/bin/admincmd/bpimagelist";
if (!defined($opt_c) || !defined($opt_s)) {
print "Usage: $0 -c <class,class,...> -s <start-date> -e <end-date>\n";
exit 1;
}
if (! defined($opt_e)) {
@time=localtime(time);
$opt_e=sprintf("%02d/%02d/%02d
%02d:%02d:%02d",$time[4]+1,$time[3],$time[5]-100,$time[2],$time[1],$time[0])
;
}
$opt_s=~s/\./ /;
$opt_e=~s/\./ /;
print "Checking for Classes: $opt_c\n";
print "Start time: $opt_s\n";
print "End time : $opt_e\n\n";
@classes=split(/,/,$opt_c);
foreach $class (@classes) {
# print "Checking for $class\n";
@data=`$bpm -media -l -d $opt_s -e $opt_e -class $class`;
foreach $line (sort @data) {
($tape,$host,$ltime,$rest)=split(/ /,$line);
@time=localtime($ltime);
$date=sprintf("%02d/%02d/%02d
%02d:%02d:%02d",$time[4]+1,$time[3],$time[5]-1
00,$time[2],$time[1],$time[0]);
print "$tape \t$class($host) \t$date\n";
}
print "\n";
}
print "End of Line\n";
exit;
--
-------------------------------------
Dan Logcher W91-219C ASST UNIX Admin
Massachusetts Institute of Technology
dlogcher AT mit DOT edu 617-324-5800
_______________________________________________
Veritas-bu maillist - Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
|