www.bob.tw

透過指令方式備份 Remote Server Event Log

透過指令方式備份 Remote Server Event Log

1.Download NirSoft “MyEventVirwer”

2.Batch File :

rem 取得日期、時間
set /a year=%date:~,4%
set month=%date:~5,2%
set day=%date:~8,2%
set hh=%time:~,2%
set mm=%time:~3,2%
set ss=%time:~6,2%

set mydate_en=%year%.%month%
if not exist “\\fileserver\Log_Backup\%mydate_en%” (md “\\fileserver\Log_Backup\% mydate_en%”)

rem 備分遠端主機(wwwfile),並存放至fileserver

myeventviewer /remote \\webserver      /showonlylastevents 1 /savedirect /stext \\fileserver\Log_Backup\%mydate_en%\%mydate%_webserver.log

備註:

1.因取日期、時間的方式忘記從那裡看到,如有人知道可麻煩告知,本人會註明出處 ^^
2.備份遠端的event log的參數可參考MyEventViewer  Docunemt.

You May Have Missed