Veritas-bu

[Veritas-bu] Netbackup command to check existence of a specific copy # and retention level

2005-10-10 05:26:33
Subject: [Veritas-bu] Netbackup command to check existence of a specific copy # and retention level
From: dave.markham AT fjserv DOT net (Dave Markham)
Date: Mon, 10 Oct 2005 10:26:33 +0100
You could use bpverify and some of its options as that has -cn option.

The last field on the command shown below shows if it is a copy or not. 
If it = 1 its a primary copy and if it = 0 its not.
Therefore you could do a match on the last field $(NF) or something in 
awk and if its not a primary ( it must be a copy ) and you can output 
what you want.

Sample command and output.from some notes i got( although this uses 
hoursago or a date )


bpverify -PD -M <master> -X -s 1107273146 -e 1107388799 -cn 1 -client 
<client>
-PD shows info, there is -p and -pb also. -PD doesnt look documented.
-M master server
-X ??
-s start date. Shown is epoch but can be mm/dd/yyyy
-e end date
-cn 1 is copy number 1. Can be -cn 2 or -primary
-client client

Can have hours ago, schedules all sorts

#Ouput EG
Backup id  Policy   Schedule   client and image            master   
media  copy primary
1107295704 Standard Daily_Cinc <client>_1107295704 <master> T20052 1     1

 > bpverify -PD -M <master> -X -s 1107273146 -e 1107388799 -cn 2 -client 
<client>
1107295704 Standard Daily_Cinc <client>_1107295704 <master> T20027 2 0 
<- 0 means not primary



Hope this helps




Lien, Mitch wrote:

>Hi.
>
>I am writing a shell script that will be used to validate Vault
>duplication jobs.
>
>Specifically, we want to know that all of our clients/policies have
>duplicated correctly and have the correct retention level.
>
>
>Within the script, I have a line which is similar to the following:
>
>bpimmedia -client $CLIENT -policy $POLICY -d $START_DATE -e $END_DATE
>-cn $COPY_NUMBER -rl $RETENTION_NUMBER
>
>Example:
># bpimmedia -client sapdbpr1 -policy sapdbpr1_PRD_Daily_L700 -d
>10/01/2005 -e 10/05/2005 -cn 2 -rl 3
>IMAGE sapdbpr1 7 sapdbpr1_1128513878 sapdbpr1_PRD_Daily_L700 0
>Daily-Full-sapdbpr1L700 0 3 179 1129723478 0 0
>FRAG 1 1 29920 0 2 6 641 M02545 laxstg1.corp.minimed.com 262144 1189199
>1114689840 5 0 *NULL* 1131192278 0 3
>FRAG 2 1 29920 0 2 6 8 M02746 laxstg2 262144 38664 1128524650 0 0 *NULL*
>1129723478 0 1
>
>
>When the above command is run, the output always shows both copy 1 and
>copy 2 information. If there isn't a copy 2, it shows the copy 1 info.
>I would like the output to show "no entity found" if there isn't a copy
>2. From what I can see, the "-cn" is getting ignored. I have tried using
>the "-spangroups" argument, but that does not appear to work and I am
>not sure what it is doing.
>
>
>I have had some luck with the "bpduplicate -PM -cn <copy number> -policy
><policy name> -client <client name> -s <start date> -e <end date>"
>command. It is telling me if a specific copy does exist or not; however,
>it is not accepting the retention level "-rl" argument. When I attempt
>to use "-rl" it appears to be ignored.
>
>
>If anyone has a way to query the image db by copy # and retention level
>and get a true/false type output, I would appreciate your help.
>
>Thanks.
>
>Mitch 
>
>_______________________________________________
>Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
>http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
>
>  
>