Video Screencast Help
Symantec Appoints Michael A. Brown CEO. Learn more.

bpend_notify

Created: 12 Dec 2012 • Updated: 14 Dec 2012 | 7 comments
Tom Egger's picture
This issue has been solved. See solution.

We are looking for a solution how to obtain the backup state from the client side.

Is this possible with the script bpend_notify and how?

thank you for the Ideas.

Comments 7 CommentsJump to latest comment

revaroo's picture

What is the OS of the client?

Any reasons why you need to know from the client end the backup state, this may help us help you.

 

Have you read this technote?

http://www.symantec.com/business/support/index?pag...

Marianne's picture

It is possible, but it seems bpend is not reliable in this regard.

See this extract from Admin Guide II:

 

NetBackup passes the following parameters to the script:
clientname     Specifies the name of the client from the NetBackup catalog.
policyname    Specifies the policy name from the NetBackup catalog.
schedname   Specifies the schedule name from the NetBackup catalog.
schedtype     Specifies one of the following: FULL, INCR (differential incremental), CINC (cumulative incremental), UBAK, UARC
 
exitstatus     Specifies the exit code from bpbkar. The status is the client status 
                    and does not indicate that the backup is complete and successful.
                   The client can display a status 0 when, due to a failure on the server,
                    the All Log Entries report displays a status 84.
 
 
Rather look at email notification. 
See this TN for settings and behaviour: http://www.symantec.com/docs/TECH64984

 

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

mph999's picture

Marianne has a good point, but this only shows that exit state of bpbkar, it does not mean that the backup completed successfully, only thay the bpbkar bit of it exited with no error.

I don't believe it is possible to get the overall status of a backup from a client.

Martin

 

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

Dumb question and I've probably overlooked something but I'll ask it anyway: why not set up email notification?


bit.ly/76LBN | APPLBN | 75LBN

Tom Egger's picture

Now, we have to this and then a other script will be read the status code.

Thanks

 

@REM $Id: bpend_notify.bat,v 1.3 2006/08/01 20:46:43 $
@REM ***************************************************************************
@REM * $VRTScprght: Copyright 1993 - 2012 Symantec Corporation, All Rights Reserved $ *
@REM ***************************************************************************
@REM ecpyrght
@REM
@REM bpend_notify.bat
@REM
@REM This script is called by NetBackup when bpbkar is finished doing a
@REM backup on the client. It is also called after backing up the files
@REM for a user directed archive, but before the files are deleted.
@REM
@REM This script receives 6 parameters:
@REM   %1 = CLIENT_NAME
@REM   %2 = POLICY_NAME
@REM   %3 = SCHEDULE_NAME
@REM   %4 = SCHEDULE_TYPE, one of the following: FULL, INCR, CINC, UBAK, UARC
@REM   %5 = Status of backup
@REM   %6 = RESULT_FILE
@REM
@REM   The script must reside in in the same directory as the rest of the NetBackup
@REM   client binaries (install_path\netbackup\bin\bpend_notify.bat).
@REM   It must also be executable by the root user.
@REM   Should exit with 0 upon successful completion
@REM
@REM Naming conventions:
@REM   There are three different versions of names that the scripts can use.
@REM   The start notify script may use one version and the end notify script may use
@REM   another, or they can both use the same version.
@REM
@REM   Substitute "policy" with the NetBackup policy being used and "sched" with the
@REM   schedule name.  "bpend" can be substituted with "bpstart".
@REM   bpend_notify.policy.sched.bat
@REM   bpend_notify.policy.bat
@REM   bpend_notify.bat
@REM
@REM Result files:
@REM   The result file names will be dependant on the script file names.
@REM   Example:
@REM   Script name:                         Result file name:
@REM   bpstart_notify.policyA.schedB.bat    BPSTART_RES.policyA.schedB
@REM   bpstart_notify.policyB.bat           BPSTART_RES.policyB
@REM   bpend_notify.bat                     BPEND_RES
@REM   bpend_notify.policyC.bat             BPEND_RES.policyC
@REM
@REM CAUTION: Writing anything to stdout or stderr will cause backup problems.
@REM          Output should be redirected to the results files.
@REM
@REM --------------------------------------------------------------------
@REM main script starts here
@REM This is a simple script that records what kind of backup was done along
@REM with other relevent information (Client name, policy name, etc) and
@REM appends the information to the results file
@REM --------------------------------------------------------------------
@if "%4" == "FULL" goto FULL
@if "%4" == "CINC" goto CINC
@if "%4" == "" goto FAIL
@REM print a generic message since backup is neither full, nor cumulative incremental
@echo backup/restore finished on %1 using policy %2 with schedule %3 and status %5, bpres = %6 >> bin\BP_RES.txt
@echo 0 >> %6
@GOTO :EOF
@REM exit 0
:FULL
@echo full backup finished on %1 using policy %2 with schedule %3 and status %5, bpres = %6 >> bin\BP_RES.txt
@echo 0 >> %6
@GOTO :EOF
@REM exit 0
:CINC
@echo cumulative incremental backup finished on %1 using policy %2 with schedule %3 and status %5, bpres = %6 >> bin\BP_RES.txt
@echo 0 >> %6
@GOTO :EOF
@REM exit 0
:FAIL
@REM no schedule type information was sent.  A failure has occured.  Write status 1 to results files.
@echo 1 >> %6
@GOTO :EOF
@REM exit 0

SOLUTION
Marianne's picture

Did you see what we said above?

That the status code from bpend is that bpbkar status code and the overall status code from server perspective?

That we suggested email notification rather than relying on bpend_notify?

Supporting Storage Foundation and VCS on Unix and Windows as well as NetBackup on Unix and Windows
Handy NBU Links

Tom Egger's picture

Yes I saw this, but it is the wish of our customer