cancel
Showing results for 
Search instead for 
Did you mean: 

Netbackup: Generate files on tapes

Puffy
Level 6
 Hi,

I'm trying to find the report to do this. Also checking on the command list.

Wonder anyone knows of this as well.

Basically generate the contents of the files on tapes. The best I can get is the image file on the tapes. 

Thanks.


1 ACCEPTED SOLUTION

Accepted Solutions

Yasuhisa_Ishika
Level 6
Partner Accredited Certified
Run this with media id args.

#! /usr/bin/perl -w
foreach $media (@ARGV){
open(FH,"bpimmedia -mediaid $media|");
while(<FH>){
@v=split(" ");
if($v[0] ne "IMAGE"){next}
$ts=$v[3];
$ts=~/.*_(\d+)$/;
@t=localtime($1);
print "# Backup ID: $v[3]\n";
$bt=sprintf("%02d/%02d/%04d %02d:%02d:%02d",$t[4]+1,$t[3],$t[5]+1900,$t[2],$t[1],$t[0]);
system("env LANG=C bplist -t $v[5] -s $bt -e $bt -R -C $v[1] /");
}
close(FH);
}

View solution in original post

4 REPLIES 4

quebek
Moderator
Moderator
   VIP    Certified
Whoa
This is not the easy to find directly.
What You can actually do is to get lists of backup images ID.
Then basing on backuID timestmap You can try to run bplist for this time frame and particular client.
This won't be so obviuos to script but can be done ;D

Nicolai
Moderator
Moderator
Partner    VIP   

Try this command

bpflist -l -client {hostname} -ut {epoch time} -option GET_ALL_FILES -rl 999

{hostname} = Replace with you’re own Netbackup client name
{Epoch time} = UNIX time when the backup started (the number in the Image ID is the epoch time  )

Regards

Nicolai


Yasuhisa_Ishika
Level 6
Partner Accredited Certified
Run this with media id args.

#! /usr/bin/perl -w
foreach $media (@ARGV){
open(FH,"bpimmedia -mediaid $media|");
while(<FH>){
@v=split(" ");
if($v[0] ne "IMAGE"){next}
$ts=$v[3];
$ts=~/.*_(\d+)$/;
@t=localtime($1);
print "# Backup ID: $v[3]\n";
$bt=sprintf("%02d/%02d/%04d %02d:%02d:%02d",$t[4]+1,$t[3],$t[5]+1900,$t[2],$t[1],$t[0]);
system("env LANG=C bplist -t $v[5] -s $bt -e $bt -R -C $v[1] /");
}
close(FH);
}

quebek
Moderator
Moderator
   VIP    Certified
Thank You Yasuhisa, this script is working. I just copied it to my cheat sheet ;D