cancel
Showing results for 
Search instead for 
Did you mean: 

command to get the stat and end time of a client backup

NIKHIL234656595
Level 6

Hi,

Can anybody know the command to get the stat and end time of a client backup .

2 ACCEPTED SOLUTIONS

Accepted Solutions

Will_Restore
Level 6

try   bpdbjobs -all_columns | awk -F","  '{print $7, $9, $11, $10, $4}'

View solution in original post

mph999
Level 6
Employee Accredited

It is the 7th, 9th 11th 10th and 4th fields of the comma separate output of the bpdbjobs -all_columns command.

However, the lines can be very long, and awk sometimes will not work.

 

If I run bpdbjobs -most_columns - these are the first 11 columns

384,0,3,237,womble_ad_disk,Full,*NULL*,,1333911123,0000000000,1333911123

These are ...

jobid,jobtype,state,status,class,schedule,client,server,started,elapsed,ended

I think this is better :

NOTE :  THIS WILL ONLY WORK ON UNIX ... (awk does not work on windows)

 bpdbjobs -most_columns |awk -F, '{print $1" "$5" "$6" "$9" " $11}'

This command gives the 1, 5th, 6th, 9th and 11th fields which from the descriptions are :

jobid  class/ policy  schedule  start time  end time

The output looks like this :

 

bpdbjobs -most_columns |awk -F, '{print $1" "$5" "$6" "$9" " $11}'
 
384 womble_ad_disk Full 1333911123 1333911123
383 womble_ad_disk Full 1333910914 1333910940
382   1333890199 1333890202
381   1333846995 1333846998
380   1333803792 1333803795
379   1333760589 1333760599
378 flump Full 1333724587 1333724600
377   1333717385 1333717388
376   1333674181 1333674192
375 CatBack_Disk Full 1333645255 1333645270
374 CatBack_Disk Full 1333645222 1333645250
373 CatBack_Disk Full 1333645201 1333645251
372 CatBack_Disk - 1333645200 1333645270
 
For some lines we see only a jobid and times, these are probably image cleanups,  jobid 372 is a parent job for the catalog backup, so there is no 'schedule' shown.
 
Basically, you are not going to easily get a perfect output - but I think this is good enough  as it is very easy to read down and just pick out the lines that are relevant .
 
To convert the times (the long numbers) you can use bpdbm -ctime <ctime>
 
For example :
 
bpdbm -ctime 1333911123
1333911123 = Sun Apr  8 19:52:03 2012
 
 
Martin

View solution in original post

12 REPLIES 12

NIKHIL234656595
Level 6

 

i am looking for a command to list the backups information (as in the activity monitor)

like

client >>>> $7

start time >>>> $9

end time >>>> $11

active elapsed time >>>> $10

status >>>> $4

 

Plz provide the awk script or command for this?

Marianne
Level 6
Partner    VIP    Accredited Certified

NIKHIL234656595
Level 6

 

Parse bpdbjobs?

How to do this?

Mark_Solutions
Level 6
Partner Accredited Certified

As per the tech note Marianne gave the link to above ....

Just run the bpdbjobs command with the switches you require - read through the tech note

Marianne
Level 6
Partner    VIP    Accredited Certified
It seems you have found this post:
https://www.veritas.com/connect/forums/re-command-list-backups-status-and-timings
'parse' means that you can use shell commands such as grep and awk to extract specific info.
If you google
netbackup bpdbjobs awk
you will be guaranteed to find some examples!
You can also do a 'man awk' from cmd to learn what awk can do for you.

Amarnath_Sathis
Level 5

Is the command Given is right.

If I execute this Im not getting any output.

/usr/openv/netbackup/bin/admincmd/bpdbjobs -all_columns | awk '{print $7, $9, $11, $10, $4}'

Will_Restore
Level 6

try   bpdbjobs -all_columns | awk -F","  '{print $7, $9, $11, $10, $4}'

Amarnath_Sathis
Level 5

 

Hi wr,
 
I have executed the command given by you and I'm getting the error as below,
 
zeus# /usr/openv/netbackup/bin/admincmd/bpdbjobs -all_columns | awk -F","  '{print $7, $9, $11, $10, $4}'
awk: record `1049055,0,3,0,ECOLLP...' too long
zeus#

NIKHIL234656595
Level 6

 

-bash-3.2$ sudo ./bpdbjobs -all_columns | awk -F","  '{print $7, $9, $11, $10, $4}'

 

 1332494446 0000000000 0000000424

 1332494446 0000000000 0000000424

 1332494446 0000000000 0000000424

 1332494446 0000000000 0000000424

lxyump 1332494492 1332494808 0000000316 0

 1332494032 0000000000 0000000838

lxyump 1332494058 0000000000 0000000812

 

lxyump34   1332493981 133

 

What is this?

NIKHIL234656595
Level 6

please update on this?

mph999
Level 6
Employee Accredited

It is the 7th, 9th 11th 10th and 4th fields of the comma separate output of the bpdbjobs -all_columns command.

However, the lines can be very long, and awk sometimes will not work.

 

If I run bpdbjobs -most_columns - these are the first 11 columns

384,0,3,237,womble_ad_disk,Full,*NULL*,,1333911123,0000000000,1333911123

These are ...

jobid,jobtype,state,status,class,schedule,client,server,started,elapsed,ended

I think this is better :

NOTE :  THIS WILL ONLY WORK ON UNIX ... (awk does not work on windows)

 bpdbjobs -most_columns |awk -F, '{print $1" "$5" "$6" "$9" " $11}'

This command gives the 1, 5th, 6th, 9th and 11th fields which from the descriptions are :

jobid  class/ policy  schedule  start time  end time

The output looks like this :

 

bpdbjobs -most_columns |awk -F, '{print $1" "$5" "$6" "$9" " $11}'
 
384 womble_ad_disk Full 1333911123 1333911123
383 womble_ad_disk Full 1333910914 1333910940
382   1333890199 1333890202
381   1333846995 1333846998
380   1333803792 1333803795
379   1333760589 1333760599
378 flump Full 1333724587 1333724600
377   1333717385 1333717388
376   1333674181 1333674192
375 CatBack_Disk Full 1333645255 1333645270
374 CatBack_Disk Full 1333645222 1333645250
373 CatBack_Disk Full 1333645201 1333645251
372 CatBack_Disk - 1333645200 1333645270
 
For some lines we see only a jobid and times, these are probably image cleanups,  jobid 372 is a parent job for the catalog backup, so there is no 'schedule' shown.
 
Basically, you are not going to easily get a perfect output - but I think this is good enough  as it is very easy to read down and just pick out the lines that are relevant .
 
To convert the times (the long numbers) you can use bpdbm -ctime <ctime>
 
For example :
 
bpdbm -ctime 1333911123
1333911123 = Sun Apr  8 19:52:03 2012
 
 
Martin

NIKHIL234656595
Level 6

HI,

 

Is there a command to get the time in Sun Apr  8 19:52:03 2012 format when i run bpdbjobs.