cancel
Showing results for 
Search instead for 
Did you mean: 

Question on bpimagelist

AKopel
Level 6
Hello,
I am trying to create a script that will generate a list of tapes for me.

All of my Full backups are run as in-line copy. 1st copy is "Primary" with 3 week retention and stays in the library for local restores. 2nd copy goes Offsite with 5 week retention.

I want to create a list of all tapes with retention level of 5 weeks that have been written in the last 4 days which in theory should be outputted with this command:

bpimagelist -media -hoursago 96 -rl 11 -idonly

The problem I am having is that bpimagelist seems to only list Primary copies of backup media so all of my in-line jobs (the ones I want) do not show up with this command.

Does anyone have any suggestions?

Thanks!
Aaron Kopel
6 REPLIES 6

h_m
Level 6
The only way I can think of doing it is to identify the copy 2 backup ID and then use the backup ID to work out which tape it is on (do this repeatedly for each copy 2 backup ID).

AKopel
Level 6
OK, I think I have found a way to do this using vmquery instead.

I run this command:
vmquery -h mgobpmas1 -b -pn Friday-Offsite|qgrep -v NONE|qgrep -f dates.txt > Friday-Offsite.txt

where dates.txt is a list of dates that I want to filter tape out from. The only difference is that I am doing it based on "Last Mount" instead of "Last Written" which in most cases will be correct.

h_m
Level 6
Just be aware that "last mount" does not mean any data was written to that tape on the date in question.

And if you have to manually construct the *.txt file for the date then it�s a bit of an overhead.

Could you not look at the bptm log and do something with the entries in that?

AKopel
Level 6
Yea, I'm aware of that. The nice thing, is that there should be very few (if any) tapes in the library because they all should be offsite (except for the ones that were just written) The only exception, would be tapes that have been returned for restores, which I do have to figure out how to filter out.
constructing the txt file is no problem. I already created that to prompt for the starting date, and it will simply count up until "today" and write these dates one by one.

The purpose for this, is for our operations group to eject the offsite tapes on Monday. I want them to run a program that will put a description on the tapes with the offsite box number (which they know) and the date ejected. Then they can go into the Volume Pools and filter by description to know exactly which tapes to eject.

as for bptm, which entries would I look for? seems like alot of data to sort through, plus we have 9 media servers so it would be quite a few places to look.

AKopel
Level 6
OK,
another update (for anyone else trying to do this)

Looks like I can do this to filter out ONLY the tapes that have been written too in my dateframe:


vmquery -b -pn Friday-Offsite|qgrep -v NON|qgrep -f dates.txt>FO1.txt
bpmedialist -p Friday-Offsite|qgrep hcart|qgrep -f dates.txt >FO2.txt

Then I parse out JUST the mediaID from each FOx.txt file into FO1-bare.txt and FO2-bare.txt

Then I run:

qgrep -f FO1-bare.txt FO2-bare.txt>Friday-Offsite-Final.txt

Works great!

Aaron

ole_gunner
Level 3
Hi, I was once asked to try and find out how much data we sent off site each night so I ran a bpverify command againgst the catalogue which specifically looked for copy 2 tapes. You may be able to play around with this command to get you what you want

bpverify -l -p -s 12/02/2005 00:01:00 -e 12/02/2005 23:59:59 -cn 2

I piped this out to a text file and then imported into excel.
Have a play around with the options and see if this can list whatb you want.
Cheers