cancel
Showing results for 
Search instead for 
Did you mean: 

Backup_exit_notify not working in MP4??

Chad_Wansing
Level 4
Anybody have any idea why a backup_exit_notify script may be intermittently not working after installing MP4? I'm getting notifications like I'm suppossed to from one of my sites, but not the other two. I'm pretty sure everything's setup like it's suppossed to be, but maybe someone here has an idea of something to check that I'm missing.
10 REPLIES 10

zippy
Level 6
Chad,

UNIX or Winders?

Chad_Wansing
Level 4
Windows 2k3 sp1. We had this working like a champ, and I've reinstituted the script after the MP4 upgrade, and one of our master servers is even sending e-mails like it's supposed to (and all three servers use the exact same script, I just change one word for the location in each one), so this is killing me why it's not working.

zippy
Level 6
I hear there is a patch for this problem, I saw it on one of the Posts this week.

Chad_Wansing
Level 4
Thanks James, I'll see if I can find that.......

zippy
Level 6
http://forums.symantec.com/discussions/thread.jspa?threadID=69725&tstart=0

here it is, its something to do with MP5

Chad_Wansing
Level 4
So, an update on the issue......it's not resolved, but it's not what we thought. There's also some additional weirdness added in.

So my master servers in Phoenix and Atlanta hose the file every time I try and save it on them. I'm using notepad, copying and pasting the relevent portion of the backup_exit_notify script that I had saved into the canned version. Everything goes in just fine. Looks perfect. I hit Control-S to save it and it looks fine, but when you go back into the file, the formatting is all kind of stupid. As illustrated:

@REM@REM $Header: backup_exit_notify.cmd,v 1.2 2002/11/20 02:10:34 $@REM@REM bcpyrght@REM ***************************************************************************@REM * $VRTScprght: Copyright 1993 - 2006 Symantec Corporation, All Rights Reserved $ *@REM ***************************************************************************@REM ecpyrght@REM@REM backup_exit_notify.cmd@REM@REM This script is called by the NetBackup scheduler, after an individual@REM client backup has completed (including media closure and image db@REM validation.@REM@REM NOTE: this script will always be run in "background" mode, meaning that@REM the NetBackup scheduler will NOT wait for it's completion.@REM@REM This script:@REMreceives 5 parameters: @REM%1 = CLIENT - the client hostname@REM%2 = POLICY - the policy label@REM%3 = SCHEDULE - the schedule label@REM%4 = SCHEDULE_TYPE - the type of schedule: FULL INCR UBAK@REM UARC@REM%5 = STATUS - the backup status for this job@REM%6 = STREAM - the backup stream number for this job@REM@REM - Main program ------------------------------------------------------------@REM -@REM - This script only runs on NT 4.0 and succeeding versions of NT. You must@REM - have command extensions enabled. Check the following registry entry:@REM -@REM - HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions@REM -@REM - It should be set to 0x1 or you may have problems running this script.@REM ---------------------------------------------------------------------------@setlocal ENABLEEXTENSIONS@set LISTPATHS="%~dp0\goodies\listpaths"@for /F "delims=|" %%p in ('%LISTPATHS% /s NB_MAIL_SCRIPT') do @set NB_MAIL_SCRIPT="%%p"@set OUTF="%~dp0\BACKUP_EXIT_CALLED"@REM ---------------------------------------------------------------------------@REM - Get date and time.@REM ---------------------------------------------------------------------------@for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q@for /F %%p in ('time /T') do @set DATE=%DATE% %%p@REM ---------------------------------------------------------------------------@REM - Check for proper parameter use.@REM ---------------------------------------------------------------------------@if "%6" == "" goto BadParams@if "%7" == "" goto GoodParams:BadParams@echo %DATE% backup_exit_notify expects 6 parameters: %* >> %OUTF%@goto EndMain:GoodParams@REM ---------------------------------------------------------------------------@REM - You may want to delete the output file elsewhere in order to@REM - accumulate successful backup information. If so, delete the@REM - following line or move it to where it will do the most good.@REM ---------------------------------------------------------------------------@if exist %OUTF% del %OUTF%@REM ---------------------------------------------------------------------------@echo %DATE% ----------------------------- >> %OUTF%@echo %DATE% CLIENT: %1 >> %OUTF%@echo %DATE% POLICY: %2 >> %OUTF%@echo %DATE% SCHEDULE: %3 >> %OUTF%@echo %DATE% SCHEDULE TYPE: %4 >> %OUTF%@echo %DATE% STATUS: %5 >> %OUTF%@echo %DATE% STREAM: %6 >> %OUTF%@echo %DATE% ----------------------------- >> %OUTF%@REM ---------------------------------------------------------------------------@REM - might want to mail this info to someone@REM -@REM - @call %NB_MAIL_SCRIPT% someone_who_cares "NetBackup backup exit" %OUTF%@REM ---------------------------------------------------------------------------@REM if "%5" equ "150" goto EndMain
@REM if "%5" equ "200" goto EndMain
@if "%5" gtr "1" goto SendEmail
@goto EndMain
:SendEmail
@blat %OUTF% -s Enterprise_Netbackup_Atlanta -t globalhelpdesk@ikon.com -i NetBackup -server atlsmtp.ikon.org -q
@endlocal
:EndMain
@endlocal
@REM - End of Main Program -----------------------------------------------------

As you'll notice, the last couple of lines are perfectly fine. These are the only lines we changed from the canned script. That's why I wondered if it was something about the new version of the script MP4 put out there.

HOWEVER, when I was working on the script on our master server in Houston, everything worked perfectly, just how it should, and I could copy the results to the other master servers and have everything work.....as long as they didn't save the file.

So now it looks like it's something in Windows or on these particular machines (and my desktop) that's hosing up the formatting.

Hopefully, if there's anyone else out there who's having this kind of hard time, maybe this will help out. And for reference sake, here's what it SHOULD look like (although I'll be un-REM-ing the status 150 bypass shortly....needed that in there for testing):

@REM

@REM $Header: backup_exit_notify.cmd,v 1.2 2002/11/20 02:10:34 $

@REM

@REM bcpyrght

@REM ***************************************************************************

@REM * $VRTScprght: Copyright 1993 - 2006 Symantec Corporation, All Rights Reserved $ *

@REM ***************************************************************************

@REM ecpyrght

@REM

@REM backup_exit_notify.cmd

@REM

@REM This script is called by the NetBackup scheduler, after an individual

@REM client backup has completed (including media closure and image db

@REM validation.

@REM

@REM NOTE: this script will always be run in "background" mode, meaning that

@REM the NetBackup scheduler will NOT wait for it's completion.

@REM

@REM This script:

@REMreceives 5 parameters:

@REM%1 = CLIENT - the client hostname

@REM%2 = POLICY - the policy label

@REM%3 = SCHEDULE - the schedule label

@REM%4 = SCHEDULE_TYPE - the type of schedule: FULL INCR UBAK

@REM UARC

@REM%5 = STATUS - the backup status for this job

@REM%6 = STREAM - the backup stream number for this job

@REM

@REM - Main program ------------------------------------------------------------

@REM -

@REM - This script only runs on NT 4.0 and succeeding versions of NT. You must

@REM - have command extensions enabled. Check the following registry entry:

@REM -

@REM - HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions

@REM -

@REM - It should be set to 0x1 or you may have problems running this script.

@REM ---------------------------------------------------------------------------

@setlocal ENABLEEXTENSIONS

@set LISTPATHS="%~dp0\goodies\listpaths"

@for /F "delims=|" %%p in ('%LISTPATHS% /s NB_MAIL_SCRIPT') do @set NB_MAIL_SCRIPT="%%p"

@set OUTF="%~dp0\BACKUP_EXIT_CALLED"

@REM ---------------------------------------------------------------------------

@REM - Get date and time.

@REM ---------------------------------------------------------------------------

@for /F "tokens=1*" %%p in ('date /T') do @set DATE=%%p %%q

@for /F %%p in ('time /T') do @set DATE=%DATE% %%p

@REM ---------------------------------------------------------------------------

@REM - Check for proper parameter use.

@REM ---------------------------------------------------------------------------

@if "%6" == "" goto BadParams

@if "%7" == "" goto GoodParams

:BadParams

@echo %DATE% backup_exit_notify expects 6 parameters: %* >> %OUTF%

@goto EndMain

:GoodParams

@REM ---------------------------------------------------------------------------

@REM - You may want to delete the output file elsewhere in order to

@REM - accumulate successful backup information. If so, delete the

@REM - following line or move it to where it will do the most good.

@REM ---------------------------------------------------------------------------

@if exist %OUTF% del %OUTF%

@REM ---------------------------------------------------------------------------

@echo %DATE% ----------------------------- >> %OUTF%

@echo %DATE% CLIENT: %1 >> %OUTF%

@echo %DATE% POLICY: %2 >> %OUTF%

@echo %DATE% SCHEDULE: %3 >> %OUTF%

@echo %DATE% SCHEDULE TYPE: %4 >> %OUTF%

@echo %DATE% STATUS: %5 >> %OUTF%

@echo %DATE% STREAM: %6 >> %OUTF%

@echo %DATE% ----------------------------- >> %OUTF%

@REM ---------------------------------------------------------------------------

@REM - might want to mail this info to someone

@REM -

@REM - @call %NB_MAIL_SCRIPT% someone_who_cares "NetBackup backup exit" %OUTF%

@REM ---------------------------------------------------------------------------

@REM if "%5" equ "150" goto EndMain
@REM if "%5" equ "200" goto EndMain
@if "%5" gtr "1" goto SendEmail
@goto EndMain
:SendEmail
@blat %OUTF% -s Enterprise_Netbackup_Atlanta -t globalhelpdesk@ikon.com -i NetBackup -server atlsmtp.ikon.org -q
@endlocal
:EndMain
@endlocal
@REM - End of Main Program -----------------------------------------------------

DavidParker
Level 6
Sounds like a 'program feature' of notepad ...
It looks like it's not saving the CR's correctly.

Have you tried Wordpad instead?

Or download a 3rd party text editor from the 'net?

Chad_Wansing
Level 4
Yes, we also tried wordpad, no difference. We did (after fixing the actual problem and getting our scripts back right) try renaming the file to .doc and editing it that way. That seemed to work, but it put double-spaces in everything. I don't think that would matter to the scripting engine, but we didn't test that out.

The only thing scripting related that I can think of between the server that works and the ones that don't is that during the MP4 install, it complained that something was wrong with the install of the vbscripting engine on the Houston server. It was an easy fix, pulled the file back down from MS, 2 min. install and everything went fine. But I don't see how that could effect the way notepad would save a file.

Stumpr2
Level 6
DOCUMENTATION: How to configure email notifications for Windows clients using BLAT and nbmail.cmd in Veritas NetBackup (tm)
http://support.veritas.com/docs/254809

Chad_Wansing
Level 4
Some additional information for anyone researching this problem:

Any time you apply an MP, it takes a copy of any kind of changeable scripts like the backup_exit_notify and sticks a copy of it in \VERITAS\Patch\\.

So, don't do like I did and go back and recreate everything manually (thereby subjecting yourself to the same extraneous problems I did), just go to the patch directory, get your stuff back and put it where it should be. It would have saved me a whole lot of heartache in this case.....