You could play with bperror to get close to what you want:
bperror -U -backstat -s info -client <clientname> -hoursago <started within this many hours>
e.g. for one of my backups that normally starts at 4:50 AM ET I ran this to see what it did today:
bperror -U -backstat -s info -client myhost -hoursago 8
That output:
STATUS CLIENT POLICY SCHED SERVER TIME COMPLETED
41 atlbks02 MYHOST-MAINDB-V Full atlbks02 08/22/2013 06:11:50
(network connection timed out)
0 atlbks02 MYHOST-MAINDB-V Full atlbks02 08/22/2013 09:29:29
0 atlbks02 MYHOST-MAINDB-V Full atlbks02 08/22/2013 10:15:33
40 atlbks02 MYHOST-MAINDB-V Full atlbks02 08/22/2013 10:34:12
(network connection broken)
0 atlbks02 MYHOST-MAINDB-V Full atlbks02 08/22/2013 10:56:57
41 atlbks02 MYHOST-MAINDB-V Full atlbks02 08/22/2013 11:32:43
(network connection timed out)
0 atlbks02 MYHOST-MAINDB-V Full atlbks02 08/22/2013 12:05:04
Caveats:
The above is a multistream policy so I’m getting information on each stream.
It truncates long policy names so what you see isn’t the full policy name for longer names.
You can’t really tell from this whether the overall backup was ultimately successful because it shows each failure and success (e.g. each attempt).
Review of the man page for bperror might help you narrow down what it shows. Also you might use this in tandem with other commands you’ve already identified
to determine if the backup was ultimately successful. This at least will show you what errors occurred.
From: veritas-bu-bounces AT mailman.eng.auburn DOT edu [mailto:veritas-bu-bounces AT mailman.eng.auburn DOT edu]
On Behalf Of Rusty Major
Sent: Thursday, August 22, 2013 11:11 AM
To: VERITAS-BU AT mailman.eng.auburn DOT edu
Subject: Re: [Veritas-bu] How to identity Status of a backup using Netbackup CLI ?
What about piping bpdbjobs output to grep and filtering there? That will give you the jobID, which you can use in future commands.
On Thu, Aug 22, 2013 at 7:13 AM, vengateshs <nbu-forum AT backupcentral DOT com> wrote:
I launch 'bpbackup' command in my program and it just gives the return code. There is no way to know the corresponding JobId.
Before I launch the next backup, I want to check the status of the Previous backup and make some decision.
'bpimagelist' command can be used with 'keyword' as filter so that I can search my backup job uniquely. Problem is, it only lists the Successful backups.
'bpdbjobs' command can be used to list out all jobs (successful, failed, in progress) but there is no way to uniquely find the backup job because it does not support filtering the result with 'keyword' attribute.
Any help is highly appreciated.
+----------------------------------------------------------------------
|This was sent by vengateshs AT gmail DOT com via Backup Central.
|Forward SPAM to abuse AT backupcentral DOT com.
+----------------------------------------------------------------------
--
Rusty Major ▪ Technical Architect and Team Lead - Backup Infrastructure Engineering ▪ Sungard Availability Services ▪ 757 N. Eldridge Pkwy., Suite 200, Houston, TX 77079 ▪ 281-584-4693 ▪ Cell 713-724-4914 ▪ rusty.major AT sungard DOT com
------------------------------------------------------------------------------
Think before you Print
CONFIDENTIALITY: This e-mail (including any attachments) may contain confidential, proprietary and privileged information, and unauthorized disclosure or use is prohibited. If you received this e-mail in error, please notify the sender and delete this e-mail
from your system.