Forum Discussion

syedzeeshan's avatar
12 years ago

Nebtackup job status script

hi ,

 

i need some assistance regarding a script which i was using before netbackup upgrade 7.5

 

windows 2008 R2

netbackup 7.5.0.4

 

here is the script i am unable to run it from nbu command line

 

C:\Progra~1\Veritas\NetBackup\bin\admincmd\bperror -U -backstat -s info -hoursago 24 >> %LOGFILE%

similary i can get the output into a output file is attached

 

 

 

Script .cmd

set LOGFILE="C:\ALJScripts\Logs\status.txt"

 

echo ------------------------------------------------------------------------------------ > %LOGFILE%
echo Summary Report by Status Code >> %LOGFILE%
echo ------------------------------------------------------------------------------------ >> %LOGFILE%

bperror -backstat -by_statcode -U -hoursago 24 >> %LOGFILE%

echo ------------------------------------------------------------------------------------ >> %LOGFILE%
echo Detail Report >> %LOGFILE%
echo ------------------------------------------------------------------------------------ >> %LOGFILE%
bperror -U -backstat -s info -hoursago 24 >> %LOGFILE%
echo ------------------------------------------------------------------------------------ >> %LOGFILE%

REM echo Below Report with Kbytes Written >> %LOGFILE%
REM bperror -all -hoursago 12 | grep Kbytes >> %LOGFILE%

REM blat %LOGFILE% -t example@abc.com -subject "Backup Status for Jobs between 8:00 AM to 8:00 AM"

 

blat is configured and i m receiving emails

but this script is not running

any work around or guidance is appreciated

 

thank you

 

 

  • You have not defined a PATH variable, so you need to specify the full path to bperror command.

4 Replies

  • Error “C:\ALJScripts\Backup_Scripts>bperror -backstat -by_statcode -U -hoursago 24  1>>

    "C:\ALJScripts\Logs\status.txt"

    'bperror' is not recognized as an internal or external command,

    operable program or batch file.”

    attach is the script error

     

  • You have not defined a PATH variable, so you need to specify the full path to bperror command.

  • Or ...

    put the full path in the script.

    Eg

     

    echo ------------------------------------------------------------------------------------ > %LOGFILE%
    echo Summary Report by Status Code >> %LOGFILE%
    echo ------------------------------------------------------------------------------------ >> %LOGFILE%

    C:\Progra~1\Veritas\NetBackup\bin\admincmd\bperror -backstat -by_statcode -U -hoursago 24 >> %LOGFILE%

    I don't understand why people don't set the PATH variable on the OS - I sit on webex and watch people type in long paths every time they run a command.

    You could set the path to the command as a variable in the script .

    eg

    set ADMINCMD="C:\Progra~1\Veritas\NetBackup\bin\admincmdt"

    Then use

    %ADMINCMD%\bperror -backstat -by_statcode -U -hoursago 24 >> %LOGFILE%

    That way, you don't have paths in the script (well, only once) and it's neater + will work on any machine.

    To set the paths, see part A in here

    https://www-secure.symantec.com/connect/forums/netbackup-basics-and-how-make-your-life-easier

    Martin

  • thanks for sharing

    since i add the variable

    i am not receiving any emails now

     

    please guide me step by step if possible add in the script

    because we have two in the script

    rem bperror -backstat -by_statcode -U -hoursago 24 >> %LOGFILE%

    echo ------------------------------------------------------------------------------------ >> %LOGFILE%
    echo Detail Report >> %LOGFILE%
    echo ------------------------------------------------------------------------------------ >> %LOGFILE%
    bperror -U -backstat -s info -hoursago 24 >> %LOGFILE%
    echo ------------------------------------------------------------------------------------ >> %LOGFILE%

    REM echo Below Report with Kbytes Written >> %LOGFILE%
    REM bperror -all -hoursago 12 | grep Kbytes >> %LOGFILE%