NTBACKUP - Script Fails in Windows 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

Have a strange one here that is driving me mad. In our environment I am
happily running scripted ntbackup jobs to complete small backups to file on
windows 2000 servers. Recently I have tried to port one of these scripts to
a 2003 server with no success. The script is as follows:

@echo off
REM - Batch file created to perform a daily backup to file on sh178edera and
move file from sh178edera to \\sh155edera\sh161Backups for tivoli tape backup.
REM - Graeme Lockhart 02/11/04

net stop "ADAM_LDAP-Staging-Area"
sleep 5
net stop "MIIServer"
sleep 5
net stop "sqlserveragent"
sleep 10
net stop "mssqlserver"
sleep 10


for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt=%dt%%tm%
set dt=%dt%

c:\windows\system32\ntbackup.exe backup "@e:\backups\sh179ederadaily.bks"
/n "%computername%-%dtt%" /d "daily %dtt%" /v:no /r:no /rs:no /hc:off /m
normal /j "SH179EDERA%dtt%" /l:s /f "e:\Backups\sh179edera%dtt%.bkf"

net start "mssqlserver"
sleep 10
net start "sqlserveragent"
sleep 10
net start "MIIServer"
sleep 5
net start "ADAM_LDAP-Staging-Area"
sleep 5


rem Copy backup summary logs to c:\backups folder from scheduled user
servicetSM

copy "C:\Documents and Settings\servicetsm\Local Settings\Application
Data\Microsoft\Windows NT\NTbackup\Data\backup*.log" e:\backups\*.* /

rem Copy backup file to sh155edera\sh178backups

net use z: /delete

net use z: \\ic001dc\sh179Backups

copy /Y e:\backups\SH179EDERA%dt%* z:\

REM del /Q e:\backups\*.bkf

net use z: /delete

exit

When the script run with bks script file surrounded by quotes and the @ is
normally required the backup fails and reports that it cannot see the bks
file. The BKS file is in the correct location is configured correctly.

If I remove the @ the backup starts but starts a shadow copy of the E
partition and completes in seconds. There is only 100MB or so at the moment
on the partition. However the BKS file is configured to back up only
selected folders on the C and E partitiions plus the system state.

The scripts function correctly on W2K servers. I have confirmed with MS
documentation at it states the BKS file must be prefixed with the @ and
quotes.

Has anyone come across this issue? Is is a Win 2003 issue?

Very frustated. Appreciate anyones help.
 
Firstly, the date / time parsing is different on W2K3, because date /t does NOT include the leading day abbreviation.
Thus your label creation is incorrect.

Did you by any chance edit the bks file and possibly cause it to write a unicode header?

http://support.microsoft.com?kbid=821730 "NTBackup Does Not Run As Expected When You Run It from a Command Prompt"
http://support.microsoft.com?kbid=872937 "The .bks file may not run successfully when you use the NTBackup utility in Windows Server 2003 to run a Unicode .bks file that the NTBackup utility did not create"



Hello

Have a strange one here that is driving me mad. In our environment I am
happily running scripted ntbackup jobs to complete small backups to file on
windows 2000 servers. Recently I have tried to port one of these scripts to
a 2003 server with no success. The script is as follows:

@echo off
REM - Batch file created to perform a daily backup to file on sh178edera and
move file from sh178edera to \\sh155edera\sh161Backups for tivoli tape backup.
REM - Graeme Lockhart 02/11/04

net stop "ADAM_LDAP-Staging-Area"
sleep 5
net stop "MIIServer"
sleep 5
net stop "sqlserveragent"
sleep 10
net stop "mssqlserver"
sleep 10


for /f "Tokens=1-4 Delims=/ " %%i in ('date /t') do set dt=%%i-%%j-%%k-%%l
for /f "Tokens=1" %%i in ('time /t') do set tm=-%%i
set tm=%tm::=-%
set dtt=%dt%%tm%
set dt=%dt%

c:\windows\system32\ntbackup.exe backup "@e:\backups\sh179ederadaily.bks"
/n "%computername%-%dtt%" /d "daily %dtt%" /v:no /r:no /rs:no /hc:off /m
normal /j "SH179EDERA%dtt%" /l:s /f "e:\Backups\sh179edera%dtt%.bkf"

net start "mssqlserver"
sleep 10
net start "sqlserveragent"
sleep 10
net start "MIIServer"
sleep 5
net start "ADAM_LDAP-Staging-Area"
sleep 5


rem Copy backup summary logs to c:\backups folder from scheduled user
servicetSM

copy "C:\Documents and Settings\servicetsm\Local Settings\Application
Data\Microsoft\Windows NT\NTbackup\Data\backup*.log" e:\backups\*.* /

rem Copy backup file to sh155edera\sh178backups

net use z: /delete

net use z: \\ic001dc\sh179Backups

copy /Y e:\backups\SH179EDERA%dt%* z:\

REM del /Q e:\backups\*.bkf

net use z: /delete

exit

When the script run with bks script file surrounded by quotes and the @ is
normally required the backup fails and reports that it cannot see the bks
file. The BKS file is in the correct location is configured correctly.

If I remove the @ the backup starts but starts a shadow copy of the E
partition and completes in seconds. There is only 100MB or so at the moment
on the partition. However the BKS file is configured to back up only
selected folders on the C and E partitiions plus the system state.

The scripts function correctly on W2K servers. I have confirmed with MS
documentation at it states the BKS file must be prefixed with the @ and
quotes.

Has anyone come across this issue? Is is a Win 2003 issue?

Very frustated. Appreciate anyones help.


Jerold Schulman
Windows: General MVP
JSI, Inc.
http://www.jsiinc.com
 
I hope I can help a little. I too used the wonderful JSI Inc. scripts
for backups, but I worked on enhancing them for Windows Server 2003 by
using some new rsm.exe commands and by tying everything together so
that I'll get an email if I didn't change the tape and an email of the
following night's backup backup report. I'm giving away the script for
free at http://ntbackup.no-ip.com to hopefully help other people out.
Maybe take a look and try it out and see if it can help you too.

Good Luck!
Thanks again to JSI Inc. for the scripts that started me out!
 
Back
Top