cancel
Showing results for 
Search instead for 
Did you mean: 

Programatic return that says "this backup is finished."

agardner
Level 3

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.

7 REPLIES 7

mph999
Level 6
Employee Accredited
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.

agardner
Level 3

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?

mph999
Level 6
Employee Accredited

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.
 
 

 

StefanosM
Level 6
Partner    VIP    Accredited Certified

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
Level 3

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

agardner
Level 3

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
Level 6
Employee Accredited
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.