cancel
Showing results for 
Search instead for 
Did you mean: 

Regular expression in NBU 7.5

Baski
Level 5
Partner Certified

Hi Team,

I want filter the NBU Jave GUI every day for some report.

Job Policy        regular expression    oradb.*|sqldb.*|exdb.*   ................it is working for me

and I need filter for schedule which starts from Application-weekly , Application-daily,Application-hourly ...etc

 

I am doing the above things as below

 

Job schedule    not equal to        application-hourly

Job chedule    not equal to        Application-Weekly

Job schedule    not equal to         client-hourly

....

.

.etc

 

How to get all information in single regular expression as Job Policy

 

Thanks for your help.

.

1 ACCEPTED SOLUTION

Accepted Solutions

watsons
Level 6

OK, now I get what you're trying to do.

One first note, I believe the "regular expression" in Netbackup GUI is just a limited set of string filters, it is not as powerful as the native OS regular expression used for shell script.

I said this becaues I have tried this before:

1)  It will work if we just want to filter jobs (by policy/schedule/client etc.) by a string that matches anything starting with "abc*", "abc?", "^abc", "abc$", or like your first filter mutliple words that ends with same string.

2)  It won't work if I am trying to do things like "inverter", which is of the syntax [^. For example, if I want to filter out job policy that is not starting with a or b, I will put in regular expression as [^ab] or even [^ab]* , but it didn't work.

Maybe you test and let me know.

A better idea, as mentioned before, is to filter out from bpdbjobs.

View solution in original post

16 REPLIES 16

RamNagalla
Moderator
Moderator
Partner    VIP    Certified

just a suggestion..

if that is the daily regular work.. why dont to try to automate it to .. using any script or reporting tool..

watsons
Level 6

Just to be sure, are you trying to get all policy & schedule information using a single regular expression?

# bppllist -L -allpolicies | egrep "Policy Name|Schedule:"

 

Or are you trying to just get a list of those policy schedules you need from the activity monitor?

# bpdbjobs 

From the output of bpdbjobs you can try to filter out your policy and/or schedule name. Should not be too tough, but if you have complex filtering to do, consider using script.

Baski
Level 5
Partner Certified

Hi Guys,

This is Daily work, We need to give report to higer Management for BC backups. For that I have to filter the JAVA GUI as per my requirement.  JOB policy, I able to get the regular expressions, but for JOB schedule i am not able to get since I do not want hourly application-weekly ...etc

For Job policy I used pipe (|) symbole for combine policies,
 

But job Schedule I do not want schedules( No idea which regular expression I should use for this purpsose)

 

Thanks for your help

Andy_Welburn
Level 6

What. where, how?

I am totally unclear as to what it is you need exactly....

As it's a daily report one would think that this has got to do with jobs .... but .....

So where exactly are you doing this filtering? What is the report supposed to be showing?

 

***EDIT***

After a re-visit, not sure it would be possible other than what you are doing now as I cannot currently find any info on what regular expressions are accepted or allowed. I know "!" is a common one for "is not" but not sure if that could be incorporated & cannot test.

Maybe a simple script could produce this same formatted output as already intimated above?

watsons
Level 6

Not sure if you use grep for your "job policy" filter or not, but if you did, you can do exclusion by doing:

egrep -v "hourly|weekly|monthly"   

That means do not search for lines matching those 3 schedules

Baski
Level 5
Partner Certified

Hi Guys,

 

I am clearly saying my first update, I Need solution for JAVA GUI not from Command line. I am explaining again, where I facing problem.

 

Right click on Java GUI goto filter click advance then goto Job Policy here I am entered all policies which required as below.

Since I am using pipe (|) symbol ( which means OR operation ). So, I am getting all my required information.

 

 

Job Policy        regular expression    oradb.*|sqldb.*|exdb.*   ................it is working for me

 

I need same reguler expression. which not required in Job Schedule. No idea how to do here.

Eg:- schedule which starts from Application-weekly , Application-daily,Application-hourly ...etc

SO, I AM DOING EVERY DAY AS BELOW

I am doing the above things as below

 

Job schedule    not equal to        application-hourly

Job chedule    not equal to        Application-Weekly

Job schedule    not equal to         client-hourly

after that I am using start Date from previous day from 6 PM .

Why I need Job schedule. Same DB have two or three policies. using DB name, hourly archive backup and some time weekly or monthly archive backups..

So, I will get BC ( Business critical) backups which are still running @ 10 AM ( Since I am using this filter at that time) and will give those backups to Management for keep the backups or kill backups before next schedule.

 

I hope I have explained clear. If not please mention where you doubt.

 

If any one give solution by using Java GUI or command/script to collect BC backups still running @ 10 AM. that is good idea.

 

 

Andy_Welburn
Level 6

Thanks for the clarification - think I got there earlier!

Unless someone can confirm otherwise with the required "regular expression" for the schedule part of the filter, I think a more suitable option (& my personal preference) would be to go for what's already been suggested - simply script it using the bpdbjobs command with "grep" & "grep -v" to 'filter' your results & you could schedule this in to occur at 10am each day to look specifically for "Active" jobs.

Will_Restore
Level 6

So, I will get BC ( Business critical) backups which are still running @ 10 AM ( Since I am using this filter at that time) and will give those backups to Management for keep the backups or kill backups before next schedule.

 

This filter would be easier:

  State  equal to   Active

 

 

watsons
Level 6

OK, now I get what you're trying to do.

One first note, I believe the "regular expression" in Netbackup GUI is just a limited set of string filters, it is not as powerful as the native OS regular expression used for shell script.

I said this becaues I have tried this before:

1)  It will work if we just want to filter jobs (by policy/schedule/client etc.) by a string that matches anything starting with "abc*", "abc?", "^abc", "abc$", or like your first filter mutliple words that ends with same string.

2)  It won't work if I am trying to do things like "inverter", which is of the syntax [^. For example, if I want to filter out job policy that is not starting with a or b, I will put in regular expression as [^ab] or even [^ab]* , but it didn't work.

Maybe you test and let me know.

A better idea, as mentioned before, is to filter out from bpdbjobs.

Baski
Level 5
Partner Certified

Hey Watsons,

Thank you for good information about filter for required job policies from bpdbjobs,

Eg:- Done here

/usr/openv/netbackup/bin/admincmd/bpdbjobs -report -t 07/30/2013  -U |egrep 'ora.*|sql.*|nas.*....etc

But I want how to filter which I do not wnat schedule type like 

 

Eg:- Waiting information here

application-hourly, application-2hours, Ora-mds-hourly ....etc

 

Thanks for help here

Andy_Welburn
Level 6

egrep -v "string1|string2|strring3" to exclude stated "strings" already mentioned in watsons earlier post

watsons
Level 6

alternatively, if you are looking at excluding all "-hourly, -weekly, -monthly, -2hours, -4hours, -10hours", just do a:

egrep -v "*ly|*hours" 

jim_dalton
Level 6

Sounds like a job for Opscenter!

Its free in the basic form and you can run reports, graphs, groups, emails etc to your hearts content.

It could be overkill in this case, but worth a go.

Jim

Omar_Villa
Level 6
Employee

If you want to automate this you will need to do it through CLI and a small script, if you want do it daily then the Java GUI will work, but honestly who wants to do a repetitive work every single day, let the machine do it for you, using OpsCenter or NBU Commands is the best solution.

Baski
Level 5
Partner Certified

Hi Watsons,

The filter gives error. might be I am using on Solaris 10.

 | egrep -v "*ly|*hours"
egrep: syntax error
 

no worries I am searching the option in google.

 

Hi Omar, Thansk for comments here. We have opcenter, but  loading the GUI  will take minimum 1 hour some time might be two hours. So, it is very difficult for us. ( the server is in remote country )

 

 

 

Baski
Level 5
Partner Certified

Hi Team,

 

Thanks for valueble solution here. Speacial thanks to Watsons and Andey,

 /usr/openv/netbackup/bin/admincmd/bpdbjobs -report -U -t 08/04/2013 17:30:00 | egrep 'oracle.*|sql-bds.*|ottr-M.*|svabd.*|mokk.*|sap.*'|egrep -v 'Application-Hourly|bsw-hourly|Client-Hourly|bsw-Hourly|Client-hourly|mett-Hourly|Client-2Hourly|Application-2Hourly|Application-hourly|Ubs-Daily|Application-Weekly|Application-hourly' |awk '{print $2,$3 ,$4 ,$5,$6,$7}'|uniq |grep -i "active" |awk '{print $3}'| uniq
 

The above filter shows only active backp from August 4th after 5: 30 PM.

offcourse we can filter like " hourly or Hourly .." will try those things..

My second target to calculate the ETA for each backup ( means how much time will take). I need compare each stream with respective disk ( how much used) with respective speed....etc

 

Thanks Omar,Jim and Wr for your comments here.

 

Cheers