Video Screencast Help

Nebtackup job status script

Created: 01 Dec 2012 • Updated: 12 Dec 2012 | 4 comments
syedzeeshan's picture
This issue has been solved. See solution.

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

 

 

Comments 4 CommentsJump to latest comment

syedzeeshan's picture

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

 

AttachmentSize
failed.txt 3.03 KB
Marianne's picture

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

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

SOLUTION
mph999's picture

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/net...

Martin

 

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

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%