Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bpend_notify scripts on Windows

Status
Not open for further replies.

doctorski

Technical User
Feb 18, 2004
22
GB
Has anybody scripted a bpend_notify.POLICY.bat script on W2K to identify the last stream to finish ?

I dont want virus checker to restart until the last stream is done. At the moment it would be restarted by all streams.

I know the STREAM_NUMBER and STREAM_COUNT but cant work out a way to only restart on last stream finish. Can do this easily in unix but struggling on windows. I have little windows scripting experience so help would be great.

4.5 MP6 HPUX Master

Many thanks in advance.

- Doctorksi
 

The $STREAM_NUMBER needs to increment a "stream counter"
then when the "stream counter" == $STREAM_COUNT,
you will know that the last stream has finished.

The same variables in UNIX are also in Windows.
I agree with you Windows scripting is hard to understand.
But I'm sure there must be some Windows savy person that can help us. you see. I'm in the same boat and I will be checking back to see who can help me out.

Bob Stump
Just because the Veritas documentation states a certain thing does not make it a fact
 
Bob,
I think I may have cracked it.

Initial testing looks promising. Try this.

@echo off

REM Netbackup script that runs after end of backup to re-start Virus checker

set OUTF=c:\"program files"\veritas\netbackup\logs\bpend_notify.POLICY.txt

date /t >> %OUTF%
time /t >> %OUTF%

echo %STREAM_NUMBER% > STREAM_NUMBER"%STREAM_NUMBER%"_COMPLETE.txt

set NEW_STREAM_COUNT=%STREAM_COUNT%

:LOOP

if EXIST STREAM_NUMBER"%NEW_STREAM_COUNT%"_COMPLETE.txt goto NEXTCHECK

goto NOSTARTUP

:NEXTCHECK

@echo "STREAM_NUMBER%NEW_STREAM_COUNT%_COMPLETE.txt EXISTS" >> %OUTF%

set /a NEW_STREAM_COUNT-=1

if %NEW_STREAM_COUNT% == 0 goto STARTUP

goto LOOP

:STARTUP

@echo "START VIRUS CHECKER" >> %OUTF%

del STREAM_NUMBER*_COMPLETE.txt

goto END

:NOSTARTUP

@echo "STREAM_NUMBER%NEW_STREAM_COUNT%_COMPLETE.txt DOES NOT EXIST" >> %OUTF%

@echo "THEREFORE NOT STARTING VIRUS CHECKER" >> %OUTF%

:END

date /t >> %OUTF%
time /t >> %OUTF%

HTH - Darren
 
Yo, the following 2 scripts will stop the Windows 'Automatic Updates' service at the start of the first backup stream and then stop the service at conclusion of last stream.

Enjoy!

@REM BPSTART_NOTIFY.bat contents:
@echo "" > c:\temp\backup\%1.%STREAM_PID%
@REM IF THIS IS THE FIRST STREAM RUNNING FOR THE CLASS SHUT DOWN THE SVC
@if %STREAM_NUMBER%==1 net stop "Automatic Updates"
@REM END BPSTART_NOTIFY.BAT
-------------------------------------------------------
@REM BPEND_NOTIFY.bat contents:
@del c:\temp\backup\%1.%STREAM_PID% /Q
@if not exist c:\temp\backup\%1.* goto :Startsvc
goto EOF
:Startsvc
net start "Automatic Updates"
@rem END BPEND_NOTIFY.BAT

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top