Dear all,
I have tested my bplist command with correct option on command prompt of windows 2008R2. The bplist command can output the backup file with size which i was expected. However, i cannot get bplist output when i merge the command into the bpend_notify.bat.
Moreover, i change grant the client's service "Netbackup Client Service" with domain admins prilevge.
CAn anyone tell me what's wrong on my script ?
@REM $Id: bpend_notify.bat,v 1.3 2006/08/01 20:46:43 $
@REM ***************************************************************************
@REM * $VRTScprght: Copyright 1993 - 2009 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 --------------------------------------------------------------------
@For /F "Tokens=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%A
@For /F "Tokens=1,2 eol=/ DELIMS=/" %%A IN ('DATE/T') DO SET mm=%%B
@For /F "Tokens=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%A
@For /F "Tokens=2,3 DELIMS=/" %%A IN ('echo %CDATE%') DO SET yyyy=%%B
@Set date=%mm%/%dd%/%yyyy%
@REM backupdate.log saved the date of launching the backup
@For /F "Tokens=1* DELIMS= " %%A IN (C:\temp\backupscript\backupdate.log) DO SET BDATE=%%A
@bplist -C %1 -k %2 -R -b -l -Listseconds -nt_files -s %date% 20:00:00 -e %BDATE% 19:00:00 D:\WMO\ > C:\temp\backupscript\WMO_backupfiles.log
@makecab.exe /d compressiontype=mszip c:\temp\backupscript\WMO_backupfiles.log \\server1\c$\temp\backupscript\WMO.cab
@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