Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

Date format in bpdbjobs ouput

Updated: 22 May 2010 | 6 comments
Anton Panyushkin's picture
0 0 Votes
Login to vote

Hello,

As far as I know bpdbjobs -all_columns can output jobs' start and end times but it does it in some unreadable format. My goal is to select jobs that has been finished during last day, how can I do that?

Comments

Stumpr2's picture
26
Sep
2006
0 Votes 0
Login to vote

use a different command.

Backup Status Report
The Backup Status report shows status and error information on jobs completed within the specified time period. If an error has occurred, a short explanation of the error is included.
# cd /usr/openv/netbackup/bin/admincmd
# ./bperror -U -backstat -s info

Richard Bannister's picture
02
Oct
2006
0 Votes 0
Login to vote

in addition to Bob's post, i have a script running every day via cron -

bash-2.05# cat NetBackup-Previous-Backstats.sh
#!/bin/ksh
#
# - first check if NetBackup is running or not.
#
if ; then
echo "This email was generated by script that calculates Previous Night's Backup Stats - '/home/richardb/NetBackup-Previous-Backstats.sh'" | /usr/ucb/mail -s "NetBackup doesn't appear to be running - pls investigate ASAP - @`date +%d/%m-%H:%M`" emailaddy@somewhere

else

# - if NetBackup is running, ONLY THEN run a backstat.
#

export mydir=/home/richardb/script-output

date > $mydir/NetBackup-Previous-Backstats.txt
echo >> $mydir/NetBackup-Previous-Backstats.txt
echo "Previous Nights NetBackup Stats (5pm thru 8am)" >> $mydir/NetBackup-Previous-Backstats.txt
echo >> $mydir/NetBackup-Previous-Backstats.txt

/usr/openv/netbackup/bin/admincmd/bperror -t backstat -U -hoursago 15|grep -v "SCH_OR" >> $mydir/NetBackup-Previous-Backstats.txt

cat $mydir/NetBackup-Previous-Backstats.txt | /usr/ucb/mail -s "NETBACKUP (UNIX) - Previous Night's Backup Stats - @`date +%d/%m-%H:%M`" emailaddy@somewhere

fi

Stumpr2's picture
10
Oct
2006
0 Votes 0
Login to vote

Hello Anton,
Well are you satisfied with creakyjoes's response?

Richard Bannister's picture
10
Oct
2006
0 Votes 0
Login to vote

I'm not quite happy with my response :) - looks like i hadn't finished it...
here's an example output from the script -

Tue Oct 10 08:00:03 BST 2006

Previous Nights NetBackup Stats (5pm thru 8am)

STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED
0 bhmcrmtest-co CL_UNIX_bhmcrmte DailyDiffI bhmsunbacku 10/09/2006 14:06:45
0 bhmcaltest-co CL_UNIX_bhmcalte DailyDiffI bhmsunbacku 10/09/2006 14:07:00
0 bhminstest-co CL_UNIX_bhminste DailyDiffI bhmsunbacku 10/09/2006 14:07:07
0 bhmsunbackup- CL_UNIX_bhmsunba DailyDiffI bhmsunbacku 10/09/2006 14:08:04
0 bhmgentest-co CL_UNIX_bhmgente DailyDiffI bhmsunbacku 10/09/2006 14:08:38
0 bhmcrmwebtest CL_UNIX_bhmcrmwe DailyDiffI bhmsunbacku 10/09/2006 14:12:07
0 bhmgentest-co CL_ATSI_bhmgente DailyFull bhmsunbacku 10/09/2006 15:09:13
0 bhmgentest-co CL_GENEVA_bhmgen DailyFull bhmsunbacku 10/09/2006 16:46:33
0 bhmgentest-co CL_GENEVA_bhmgen DailyFull bhmsunbacku 10/09/2006 16:50:32
0 bhmgentest-co CL_GENEVA_bhmgen DailyFull bhmsunbacku 10/09/2006 16:55:24
6 bhmgentest-co CL_ORACLEDB_bhmg DailyFull bhmsunbacku 10/09/2006 17:04:12
(the backup failed to back up the requested files)
6 bhmgentest-co CL_ORACLEDB_bhmg DailyFull bhmsunbacku 10/09/2006 17:04:20
(the backup failed to back up the requested files)
6 bhmgentest-co CL_ORACLEDB_bhmg DailyFull bhmsunbacku 10/09/2006 17:04:29
(the backup failed to back up the requested files)
0 bhmcrmtest-co CL_ORACLEDB_bhmc DailyFull bhmsunbacku 10/09/2006 19:00:23
0 bhmcrmtest-co CL_ORACLEDB_bhmc DailyFull bhmsunbacku 10/09/2006 19:01:19
0 bhmcaltest-co CL_ORACLEDB_bhmc DailyFull bhmsunbacku 10/09/2006 19:58:14
0 bhmgentest-co CL_ORACLEDB_bhmg DailyFull bhmsunbacku 10/10/2006 02:02:04


It's only a normal NetBackup report, a bit feeble as it doesn't give enough detail...i tend to ignore that report these days, (as i know about failures as they happen, and as i say, it's not an overly helpful report).

This is one i use if i want to see what actually successfully completed in one night (5pm thru 8am) -

JobID Type State Policy Schedule Started Elapsed Ended Kilobytes Files
=========================================================================================================================================
11856 Backup Done 0 CL_UNIX_bhmcaltest DailyDiffIncr 10/09/06 14:04:00 000:03:00 10/09/06 14:07:00 21685 386
11857 Backup Done 0 CL_UNIX_bhmcrmtest DailyDiffIncr 10/09/06 14:04:00 000:02:45 10/09/06 14:06:45 16432 405
11858 Backup Done 0 CL_UNIX_bhmcrmwebtest DailyDiffIncr 10/09/06 14:04:00 000:08:07 10/09/06 14:12:07 1076187 501
11859 Backup Done 0 CL_UNIX_bhmgentest DailyDiffIncr 10/09/06 14:04:00 000:04:38 10/09/06 14:08:38 97599 479
11860 Backup Done 0 CL_UNIX_bhminstest DailyDiffIncr 10/09/06 14:04:00 000:03:07 10/09/06 14:07:07 28220 385
11861 Backup Done 0 CL_UNIX_bhmsunbackup DailyDiffIncr 10/09/06 14:04:00 000:04:04 10/09/06 14:08:04 252374 959
11863 Backup Done 0 CL_ATSI_bhmgentest DailyFull 10/09/06 15:04:00 000:05:13 10/09/06 15:09:13 328865 5237
11864 Backup Done 0 CL_GENEVA_bhmgendev DailyFull 10/09/06 15:04:00 001:42:33 10/09/06 16:46:33 38182792 120308
11865 Backup Done 0 CL_GENEVA_bhmgentest DailyFull 10/09/06 15:04:00 001:51:25 10/09/06 16:55:25 49140148 151652
11866 Backup Done 0 CL_GENEVA_bhmgentrain DailyFull 10/09/06 15:04:00 001:46:32 10/09/06 16:50:32 43399823 134610
11869 Backup Done 0 CL_ORACLEDB_bhmcaltest DailyFull 10/09/06 17:03:58 002:54:16 10/09/06 19:58:14 0 100
11870 Backup Done 0 CL_ORACLEDB_bhmcrmdev DailyFull 10/09/06 17:03:58 001:57:22 10/09/06 19:01:20 0 100
11871 Backup Done 0 CL_ORACLEDB_bhmcrmtest DailyFull 10/09/06 17:03:58 001:56:25 10/09/06 19:00:23 0 100
11872 Backup Done 0 CL_ORACLEDB_bhmgendev DailyFull 10/09/06 17:03:59 008:58:06 10/10/06 02:02:05 0 100

Rich

DavidParker's picture
10
Oct
2006
0 Votes 0
Login to vote

Hi Richard,
Yeah, we seem to have almost exactly the same report at my company as well.
It was probably the quickest and easiest to throw together ...

Its usefulness depends on what information you really want to get out of it I guess.
In my case, I was most interested in failed jobs.

So, I wrote another script that would parse through a bpdbjobs -report output and filter out anything that didn't have a status higher than 1.

Back on topic, a nice graphic interface displaying successes, etc would be nice, I think ...

Mike Andrewjeski's picture
20
Dec
2006
0 Votes 0
Login to vote

Bob, that nightly script looks good.

I was wondering how to get the amount of data in each job? Looks like it's from from bpdbjobs?

Can you tell me the switch or field to get it from?


Thanks in advance!