12-12-2012 04:53 AM
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.
Solved! Go to Solution.
12-14-2012 05:06 AM
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
12-12-2012 05:16 AM
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?page=content&id=TECH162973
12-12-2012 05:20 AM
It is possible, but it seems bpend is not reliable in this regard.
See this extract from Admin Guide II:
12-12-2012 10:51 AM
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
12-12-2012 11:39 AM
Dumb question and I've probably overlooked something but I'll ask it anyway: why not set up email notification?
12-14-2012 05:06 AM
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
12-14-2012 05:18 AM
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?
12-14-2012 05:35 AM
Yes I saw this, but it is the wish of our customer