Link to home
Start Free TrialLog in
Avatar of Indyrb
IndyrbFlag for United States of America

asked on

solaris netbackup command for retireving media ID -- But I need only those with specific folder

I am trying to run a query from Solaris that has the netbackup DB that will list all the media ID for any servers within the policy type within some dates, Full backups, and with a certain / specific folder within the media (tape catlog)

Example. from the GUI on client you open backup archive and restore
Click on file
Specify netbackup machines and policy type
Specify server to use for backups and restores
Source/Destination
Policy Type
Then select the date range.

It will the open the server under all folders and allow you to pic the directory. Once directory has been picked, you can slect Actions - preview media and it will list what media IDs are needed for restore...

In my Example. ServerA had this listed under all folders

ServerA
             Microsoft Information Store
                                 001
                                 002
                                 003
                                 and etc.

Two issues with this approach is 1. While the preview media does show, it doesn't allow you to copy and paste into txt. And on top of that I need to run query on bunch of servers, for different date ranges.... Very very cumbersome and tedious...

So I looked up the netbackup commands and came across something that gets me partially there using the bpimagelist command
In my example below I am running bpimagelist with dates ranged from Nov 1 - Nov 21 2011
I want all servers included that have a policy type MS-Exchange-Server and only Full backups. I want the media ID for this range.... While this works... It is too much...
I only want the tapes with the date with folders like this  Microsoft Information Store \ 001
And only 001, not 002, 0003, 004 and etc...

Is there a way to script this so it does what I need and pull the information...

Here is my example.

bpimagelist -L -d 11/1/2011 -e 11/21/2011 -pt MS-Exchange-Server -st Full -media |grep "Media ID:"

But like I mentioned, it includes all information stores.... I only need 001.


Thanks


Version Netbackup 6.5.6
OS: Solaris 10 10/09

---One other question --- Is there a way to connect to the Solaris Netbackup DB remotely like SQL studio Manager and run scripts and queries against the DB?  What are the steps to do that... But the first part of my post is most critical... Again thanks
Avatar of Indyrb
Indyrb
Flag of United States of America image

ASKER

working with Symantec Support. (listing some notes incase someone else comes across this or has additional ideas.:)


I ran

bpimagelist -L -d 11/12/2011 -e 11/24/2011 -pt MS-Exchange-Server -v

This queried the catalog for all servers with the policy type "MS-Exchange-Server
inbetween the dates specified...(in verbose)
We had lots of exchange servers, so this was needed to get all of them..

I found a few different policys per the policy type MS-Exchange-Server.

When using the -v I found other fields, but definately the policy name I wanted to sort/query by -policy "EXCH_SOMEEXCHSERVERMB1"

When I run this command it gives all the Media IDs for all the servers with policy name
"EXCH_SOMEEXCHSERVERMB1"  --- way to much

bpimagelist -L -d 11/12/2011 -e 11/24/2011 -policy EXCH_SOMEEXCHSERVERMB1 |grep "ID:"

This is the policy name I wish to query.

It reports the Media IDs: for that policy name... Which is good, but I want to further filter the Media ID list to only MEDIA IDS with the folder\directory on the Media "Microsoft Information Store" DB/Site:  001

Even when I add the -C client (SERVERMB1) to the syntax it list all the media for server name SERVERMB1 and policy name "EXCH_SOMEEXCHSERVERMB1"... The only thing is there are different folders\dbs\sites on this media... I dont want everything.. Matter of fact getting everything is a lot of media....
I want to browse and filter based on
the conents within this media so only my DB name (folder name) 001 in Microsoft Information Store \ is listed and only list media IDs with the name \ site 001

I even ran the -v to see possible fields, and Unless I am missing something In the tech doc, I am not seeing it.

http://www.symantec.com/docs/TECH91133 

Maybe a combination of "bplist and bpimagelist"

How to use the "bpimagelist" utility to browse for images and media_id where they are written to

Using the [-policy policy_name] switch and naming the policy based on the selection you might be able to get the desired output.





When I run this command it gives all the Media IDs for all the servers with policy type: MS-Exchange-Server ((POLICY TYPE))

bpimagelist -L -d 11/12/2011 -e 11/24/2011 -pt MS-Exchange-Server -st Full -media |grep "Media ID:”

When I run this command it gives all the Media IDs for all the servers with policy name "EXCH_SOMEEXCHSERVERMB1"

bpimagelist -L -d 11/12/2011 -e 11/24/2011 -policy EXCH_SOMEEXCHSERVERMB1 -st Full -media |grep "ID:”

When I run this command it gives all the Media IDs for the server named ServerMB1 with policy name "EXCH_SOMEEXCHSERVERMB1"

bpimagelist -L -d 11/12/2011 -e 11/24/2011 -client SERVERMB1 -policy EXCH_SOMEEXCHSERVERMB1 -st Full -media |grep "ID:”

When I run this command it gives all the Backup Status for the server named SERVERMB1 with policy name EXCH_SOMEEXCHSERVERMB1

bpimagelist -L -d 11/12/2011 -e 11/24/2011 -client SERVERMB1 -policy EXCH_SOMEEXCHSERVERMB1 |grep "Backup Status:"

All of them are zero: 0

I also know how to get the backup id: by grepping Backup ID:
bpimagelist -L -d 11/12/2011 -e 11/24/2011 -client SERVERMB1 -policy EXCH_SOMEEXCHSERVERMB1 |grep "Backup ID:"

Any idea on how to filter on folders within the media. of only the Microsoft Information Store (DB\Site 001)

I have hundreds to do, and the GUI interface is way to clumpsy and tedious....
Even the Java Admin Console isn't ideal.... But the Java Admin console allows you to export and copy and paste, which is a plus, but still not ideall..
Server name: SERVERMB1
Policy name: EXCH_SOMEEXCHSERVERMB1
policy type: MS-Exchange-Server
start date: 11/12/2011
end date: 11/24/2011
Schedule Type "Full"
ASKER CERTIFIED SOLUTION
Avatar of Indyrb
Indyrb
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Indyrb

ASKER

Worked with Symantec on my own -- updated ee with all notes, just incase someone else comes across same issue. accepting my own comment and closing request.