Video Screencast Help

Programatic return that says "this backup is finished."

Created: 03 Oct 2013 | 7 comments

Hello Symantec world!

Just got done meeting with one of our SQL DBAs. We are well on our way to refining certain automations involving Netbackup routines against prod database instances. At the end, we were left with a simple question:

What is the programatic return that tells the master server, "this backup is finished"?

The reason for being finished is irrelevant. It failed; It succeeded; It pranced amongst the flowers in a field of autumn gold. All not important.

Another way to phrase it:

What return could I extract programmatically to tell some other program somewhere else, "Hey, this backup has finished"?

I'm not looking for 'is it still running'. Nor am I looking for 'has it started'. I am simply looking for whatever variable or boolean or whatever that will tell me that, for whatever reason, it is done.

Let me know if you have any questions, and thank you so much in advance.

Operating Systems:

Comments 7 CommentsJump to latest comment

mph999's picture

Multiple ways you could do this, the first one that sprang to mind would be nbjm / bpjobd logs. I'd have to look in them to find the exact line, but it's easy enough, run a backup and then look for the last few lines for that backup.

However, there is a major problem with this , well certainly with the bpjobd log, in that it might not always be there (that is, someone deletes it). For nbjm (apologies, don't have a system to hand to check) but the line we want may not contain the jobid which would make it very difficult to find (not all lines relating to a job in nbjm contain the jobid).

Then I thought of a better way - the trylogs. These are the 'file' equiv. of the details you see in Activity Monitor for a job.

/usr/openv/netbackup/db/jobs/trylogs

The files are named .t - so easy to find the correct one for a job.

Have a look at a few of these and see if can make use of them.

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
agardner's picture

Martin,

HUGE help.

I see at the very end of XXX.t that there is an "ended" call. Pretty fantastic. Then there's a giant integer. That seems to relate back to an integer assigned at the beginning of the process described in the trylog.

Here's my next question: we have to try to find the trylog using only the server name, or so little as the instance name of the database being backed up. Is this possible? If so, how?

agardner's picture

Another question, Martin:

I need to programatically retrieve the job number using only the name of the server and the instance being backed up for some SQL servers. Any tools there?

mph999's picture

OK, I had a look on my system.

The integer is just a ctime, NBUs way of displaying time/ date

From a trylog on my system

DestStorageUnit ad_disk_sp1
DestMediaServer womble
Transport 0
Ended 1381083458
 
I can convert this with bpdbm
 
root@womble trylogs $ bpdbm -ctime 1381083458
1381083458 = Sun Oct  6 19:17:38 2013
 
So the word 'Ended' is what you are looking for.
 
 

 

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805
 
StefanosM's picture

You can use the parent end notify script that runs on the master server to log when a job has finish.

The script can be useful to you, as passes the policy, schedule, time and other information of a job.

agardner's picture

I found a document on using this in a different context. You know of any specific documentation for using this script generally?

mph999's picture

The bpend / bpstart scripts are unsupported, so it's upto 'the user' to write.
There are some 'notes' in the script, but basically, it will run any commands that are put in it.

 

Regards,  Martin
 
Setting Logs in NetBackup:
http://www.symantec.com/docs/TECH75805