2011/8/11

NTBackup 全自動備份

@Echo Off
ECHO 備份系統狀態中…

REM 設定記錄檔路徑
Set LogFile="D:\Daily\%date:~0,4%%date:~5,2%%date:~8,2%_%time:~0,2%%time:~3,2%%time:~6,2%.TXT"
Set Slp="\\FileServer\SYSTEM\BAK_CMDS_TOOLS\sleep.exe"
SET CDT=建立於 %DATE%%TIME%

REM 備份 DHCP
netsh dhcp server export "\\FileServer\Backup\DHCP\DHCP.TXT" all

REM 4mm DDS 重新整理媒體櫃、實體媒體或特定媒體類型的所有裝置。需等待時間60秒
rsm.exe refresh /LF"SEAGATE DAT    06240-XXX SCSI Sequential Device"  >>%LogFile%
%Slp% 60

START /WAIT C:\WINDOWS\system32\ntbackup.exe backup systemstate "\\FileServer\Backup\DHCP\DHCP.TXT" /n "%CDT%" /d "%CDT%" /v:no /r:no /rs:no /hc:off /m normal /j "%dtt%" /l:f /p "4mm DDS" /UM
%Slp% 10

REM 查看備份媒體
rsm view /cgADD9B11F65144FBEA308063788D49777 /TPhysical_media >>%LogFile%

%Slp% 3
REM 退出磁帶機中的磁帶
RSM.EXE eject /PF"%CDT% – 1" /ASTART >>%LogFile%

REM 將記錄檔轉換UTF-8
"\\FileServer\SYSTEM\BAK_CMDS_TOOLS\ConvertZ\ConvertZ.exe" /i:big5 /o:utf8 %LogFile%

REM 發送通知
"\\FileServer\BLAT\blat.exe"  -install MailServer SysAdmin
"\\FileServer\BLAT\blat.exe"  %LogFile% -to lmh@tunghosteel.com -S "Daily Backup XXX System State Successful"

==================================================================================

參考資訊

用ntbackup实现无人执守备份及事件提醒
http://2mysite.net/blogview.asp?logID=252

DHCP 的 Netsh 命令
http://technet.microsoft.com/zh-tw/library/cc787375.aspx

如何使用獨立磁帶媒體櫃排定自動備份的時程
http://support.microsoft.com/kb/239892/zh-tw

Blat
http://www.blat.net/

沒有留言:

張貼留言