本脚本可以在运行Exchange 2003的计算机中对存储组进行备份。
: Michael Maher 17/01/2006
:
: FILENAME: SG1.CMD
: Script will backup Storage Group 1 for the Exchange 2003 Server
:####################################################################################################################
@echo off
: Sets the backup location
SET BACKLOC=C:
: Sets the name of the Storage Group
SET STORGP=SG1
:####################################################################################################################
:Sets the backup script location
SET SCRIPTLOC=%USERPROFILE%\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data
: Sets date variable (if needed)
For /F "Tokens=1-3 Delims=.-/ " %%A In ('Date /T') Do Set DT=%%A-%%B-%%C
: Removes expired backup files
If /i exist "%BACKLOC%\%STORGP%-DAYOLD.bkf" del "%BACKLOC%\%STORGP%-DAYOLD.bkf"
If /i exist "%BACKLOC%\%STORGP%.bkf" rename "%BACKLOC%\%STORGP%.bkf" %STORGP%-DAYOLD.bkf
: Creates the Backup Script File in Unicode Format
cmd /u /s /c echo JET %COMPUTERNAME%\Microsoft Information Store\%STORGP%\ >%SCRIPTLOC%\%STORGP%.bks
: Checks for existance of ntbackup script file
if /i exist "%SCRIPTLOC%\%STORGP%.bks" goto :EXBACKUP
echo Error - Cannot find a backup selections file script called %STORGP%.bks! Please see ntbackup help.
GOTO :EOF
:EXBACKUP
%WINDIR%\system32\Ntbackup.exe backup "@%SCRIPTLOC%\%STORGP%.bks" /n "%STORGP%" /d "%STORGP%" /v:no /r:no /rs:no /hc:off /m normal /j "%STORGP%" /l:s /f "%BACKLOC%\%STORGP%.bkf"