My company has a Windows NT 4.0 network on which we've installed Microsoft Exchange Server. I'm weary of performing nightly manual backups of the C partition. Do you have a script that I can use to automate the NT backup process?

Bob Chronister

March 22, 2001

2 Min Read
ITPro Today logo in a gray background | ITPro Today

A. My company has a Windows NT 4.0 network on which we've installed Microsoft Exchange Server. I'm weary of performing nightly manual backups of the C partition. Do you have a script that I can use to automate the NT backup process?

The following batch file lets you automate the backup of a local partition. However, this batch file is inappropriate for more complex network partitions and won't let you back up remote registries. For those situations, you need to invest in a backup application such as VERITAS Software's VERITAS Backup Exec or Computer Associates' (CA's) ARCserve. Writing even a simple local NT backup batch file can be laborious. To do so, open your favorite file editor. I recommend MS-DOS Editor, which you access from a command line by typing

edit

Your batch file first needs to use the Net Stop command to stop all Exchange Server services. (You can't back up an active service.) Type the following:

net stop MSExchangeMSMI /ynet stop MSExchangePCMTA /ynet stop MSExchangeFB /ynet stop MSExchangeDX /ynet stop MSExchangeIMC /ynet stop MSExchangeMTA /ynet stop MSExchangeIS /ynet stop MSExchangeDS /ynet stop MSExchangeSA /y

The /y switch automates the process of stopping the services by answering yes to the series of questions that the user must typically answer as the system prepares for the backup. Next, type the following backup command into your file editor:

ntbackup backup C: /b /hc:on /t:normal /l:"%windirlogfilesbackup.log" /tape:0

where the /b switch backs up the registry, the /hc:on switch enables hardware compression, the /l switch tells the backup process to write the results to a file in the NT directory's logfiles subdirectory, and the /tape:0 switch determines which tape device to use. (The 0 registry syntax directs the backup to the first tape device.)

To restart the Exchange Server services, type the following lines into your file editor:

net start MSExchangeSAnet start MSExchangeDSnet start MSExchangeISnet start MSExchangeMTAnet start MSExchangeIMCnet start MSExchangeDXnet start MSExchangeFBnet start MSExchangePCMTAnet start MSExchangeMSMI

Optionally, you can inform the user when the backup has completed. To do so, add the following line to your file:

net send user BACKUP FINISHED

Save the file as, for example, backup.bat in the NT directory and close the file editor. At the command prompt, type

at 2:00am /every:sunday "backup.bat" /interactive

where the /interactive switch handles any potential errors. This command tells the command scheduler to run backup.bat every Sunday at 2:00 a.m.

Read more about:

Microsoft
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like