Welcome! » Log In » Create A New Profile

How to identity Status of a backup using Netbackup CLI ?

Posted by vengateshs 
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.
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.com ([email]nbu-forum < at > backupcentral.com[/email])> wrote:
[quote]I launch &#39;bpbackup&#39; 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.

&#39;bpimagelist&#39; command can be used with &#39;keyword&#39; as filter so that I can search my backup job uniquely. Problem is, it only lists the Successful backups.

&#39;bpdbjobs&#39; 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 &#39;keyword&#39; attribute.

Any help is highly appreciated.

+----------------------------------------------------------------------
|This was sent by vengateshs < at > gmail.com ([email]vengateshs < at > gmail.com[/email]) via Backup Central.
|Forward SPAM to abuse < at > backupcentral.com ([email]abuse < at > backupcentral.com[/email]).
+----------------------------------------------------------------------

_______________________________________________
Veritas-bu maillist  -  Veritas-bu < at > mailman.eng.auburn.edu ([email]Veritas-bu < at > mailman.eng.auburn.edu[/email])
[url=http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu]http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu[/url]

[/quote]

--
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.com ([email]rusty.major < at > sungard.com[/email])
------------------------------------------------------------------------------
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.
How to identity Status of a backup using Netbackup CLI ?
August 22, 2013 04:31PM
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.

[b]From:[/b] veritas-bu-bounces < at > mailman.eng.auburn.edu [mailto] [b]On Behalf Of [/b]Rusty Major
[b]Sent:[/b] Thursday, August 22, 2013 11:11 AM
[b]To:[/b] VERITAS-BU < at > mailman.eng.auburn.edu
[b]Subject:[/b] 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.com ([email]nbu-forum < at > backupcentral.com[/email])> 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.com ([email]vengateshs < at > gmail.com[/email]) via Backup Central.
|Forward SPAM to abuse < at > backupcentral.com ([email]abuse < at > backupcentral.com[/email]).
+----------------------------------------------------------------------

_______________________________________________
Veritas-bu maillist - Veritas-bu < at > mailman.eng.auburn.edu ([email]Veritas-bu < at > mailman.eng.auburn.edu[/email])
[url=http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu]http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu[/url]

--
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.com ([email]rusty.major < at > sungard.com[/email])
------------------------------------------------------------------------------
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.

Athena®, Created for the Cause™
Making a Difference in the Fight Against Breast Cancer

[b]How and Why I Should Support Bottled Water!
[/b]Do not relinquish your right to choose bottled water as a healthy alternative to beverages that contain sugar, calories, etc. Your support of bottled water will make a difference! Your signatures count! Go to [url=http://www.bottledwatermatters.org/luv-bottledwater-iframe/dswaters]http://www.bottledwatermatters.org/luv-bottledwater-iframe/dswaters[/url] and sign a petition to support your right to always choose bottled water. Help fight federal and state issues, such as bottle deposits (or taxes) and organizations that want to ban the sale of bottled water. Support community curbside recycling programs. Support bottled water as a healthy way to maintain proper hydration. Our goal is 50,000 signatures. Share this petition with your friends and family today!

---------------------------------
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
----------------------------------
How to identity Status of a backup using Netbackup CLI ?
August 22, 2013 05:01PM
[quote]I launch 'bpbackup' command in my program and it just gives the return code.
There is no way to know the corresponding JobId.
[/quote]
Could you use a backup_exit_notify script to capture what you're
looking for? I have good luck getting job IDs that way doing:

JOBID=`bperror -client $1 -hoursago 1
| grep "POLICY $2" | grep "SCHED $3" | grep "EXIT STATUS $5"
| tail -n1 | awk '{print $6}'`

which, essentially, gets the job ID of the last job that finished for
the client, policy, and schedule for the job that the script is
running for (I know, I could probably collapse all those grep's into
one - this is an olde piece of code).

- Bluejay Adametz

"Snowflakes are one of nature's most fragile things, but
just look what they can do when they stick together."
- Vista M. Kelly

--

NOTICE: This message, including any attachments, is only for the use of the intended recipient(s) and may contain confidential and privileged information, or information otherwise protected from disclosure by law. If the reader of this message is not the intended recipient, you are hereby notified that any use, disclosure, copying, dissemination or distribution of this message or any of its attachments is strictly prohibited. If you received this message in error, please contact the sender immediately by reply email and destroy this message, including all attachments, and any copies thereof.

_______________________________________________
Veritas-bu maillist - Veritas-bu < at > mailman.eng.auburn.edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
Sorry, you do not have permission to post/reply in this forum.