切换到宽版
  • 5362阅读
  • 0回复

[求助]使用脚本备份Exchange存储组 [复制链接]

上一主题 下一主题
 
只看楼主 倒序阅读 0楼  发表于: 2011-03-13
— 本帖被 YOYO 从 Exchange 脚本中心 移动到本区(2015-06-25) —
  • 脚本环境:Visual Basic
  • 适合版本:Exchange 2003
  • 适用平台:
  • 脚本作用:备份存储组
本脚本可以在运行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"



分享到
快速回复
限60 字节
 
上一个 下一个