Video Screencast Help
Scheduled Maintenance: Symantec Connect is scheduled to be down Saturday, April 19 from 10am to 2pm Pacific Standard Time (GMT: 5pm to 9pm) for server migration and upgrades.
Please accept our apologies in advance for any inconvenience this might cause.

Netbackup - Using CLI

Created: 17 Dec 2012 | 6 comments

Hello,

 

I have a question regarding Symantec NetBackup command line interface.

I'm trying to work with command line only from the master server host (no Admin Console is available!!).

My problem: when I use "bpbackup" command, no 'job id' is returned, so it is problematic for me to track the parent job that is created (for getting logs, aborting it etc.)

I tried to use the pid (proc id) that is shown in the log file (when running bpbackup with -L option) and then parse the bpdbjobs -all_columns output). This may work, but I noticed that the -L output is missing the pid in case it is ran from master server.

Then I tried to see if there is a way to insert some kind of description to the backup instance. I noticed that there is a -k option to set keyword (for later restore). However, the keyward phrase is not presented in the active environment (bpdbjobs).

Does anyone has an idea/tip/trick how can I retrieve the parent job id(/job id) of a backup execution command without the GUI?

Thanks,

Avner

Discussion Filed Under:

Comments 6 CommentsJump to latest comment

Mark_Solutions's picture

Sure there is a quick way of sorting it all via the command line but you could use the follwing in a bpstart_notify.bat to pipe out the details for you:

@echo number %stream_number% >> "c:\program files\veritas\netbackup\bin\bpstart.log"
 @echo count %stream_count% >> "c:\program files\veritas\netbackup\bin\bpstart.log"
 @echo pid %stream_pid% >> "c:\program files\veritas\netbackup\bin\bpstart.log"
 @echo ============================================== >> "c:\program files\veritas\netbackup\bin\bpstart.log"

You need multiple streams enabled to use this fully but i hope this gives you some ideas

 

Authorised Symantec Consultant

Don't forget to "Mark as Solution" if someones advice has solved your issue - and please bring back the Thumbs Up!!.

avnerw's picture

Thanks Mark!

Your solution works.
However:
1. The output log is generated on each client. My program will be running only on the master server with no access to the clients.
2. Actually I don't need the stream ids, I need only the parent Job ID.

Let me try to explain my motivation:

I'm trying to write a program that will run on the master server machine and will be able to:

1. Execute bpbackup commands for specific policy -> works

2. Track the status of the backup (in case I run it with '-w', it works for execution and final status. I'd prefer also to be aware of the 'queued' status which I can know only if I have the job id)

3. Get the full backup logs - Here is my problem!

I noticed that if I have the parent Job ID, I can 'easily' extract from the bpdbjobs output the child job ids, and the output detailed log of each one of them.

For this I need the parent Job ID of an executed backup policy.
I would expect it to be the output of the bpbackup command, but it isn't :(

Any idea?

(I can do live tracking of the bpdbjobs output every X seconds, in order to identify new backups and relate them by policy/schedule/client name.
However this is a little bit tricky and might not be 100% correct in case of multiple execution concurrently)

Thanks,
Avner

Mark_Solutions's picture

On the Master (if using multiple data streams so that you get a parent job) you can use parent_start_notify,bat and parent_end_notify.bat to pipe out to a file or files, which you can then monitor, the lines should be similar to those provided but that way it all works on the Master

Alternatively the client ones will need to pipe back via a UNC path, the >> in the pipe makes it edit the file rather than overwirte it so it is possible all clients could pipe back to a single file

Hope this helps

Authorised Symantec Consultant

Don't forget to "Mark as Solution" if someones advice has solved your issue - and please bring back the Thumbs Up!!.

avnerw's picture

Thanks Mark.

1. I tried using the parent_start_notify but it didn't work (at least with the %stream_pid% etc,).
When I think of it, if I order X backups one after the other, it might be hard to locate each one by working with this file.
BTW, I'm not sure that stream_pid is related to parent Job Id (as it appears in the Activity Monitor), right?

2. Is there a way to get a job by "keyword_phrase"?

I mean, if I run bkbackup -p <policy_name> -i -w -k "Ticket123", can I somehow retrieve the job Id using the keyword 'Ticket123"?

Thanks for the help.
Avner

Mark_Solutions's picture

OK - had a quick look and stream pid is always -1 for a parent job

You have available to use the the parent notify:

%1 = CLIENT - the client hostname
%2 = POLICY - the policy label
%3 = SCHEDULE - the schedule label
%4 = SCHEDULE_TYPE - the type of schedule: FULL INCR UBAK
%5 = STATUS - the backup status for this job
%6 = STREAM - the backup stream number for this job always -1

I cannot see that the keyword gets passed to anything here

Hope this helps

Authorised Symantec Consultant

Don't forget to "Mark as Solution" if someones advice has solved your issue - and please bring back the Thumbs Up!!.

avnerw's picture

Thanks Mark.

I'll keep digging :)

Let me know if you have something else in mind.

 

Thanks,

Avner