一个用来轮转Windows下bandwidthd中html文件夹的Batch File。
@ECHO Off
REM================================
REM
REM================================
set nowDate=%date:/=-%
set nowDate=%nowDate: =-%
set nowTime=%time::=-%
set nowTime=%nowTime:~0,7%
set now=%nowdate%-%nowtime%
set year=%date:~0,4%
set month=%date:~5,2%
set day=%date:~8,2%
set baseDir=d:\bandwidthd
set sourceDir=%baseDir%\htdocs
REM set destinationDir=%baseDir%\history\%year%\%now%
set destinationDir=%baseDir%\history\%year%\%month%\%now%
rem if not exist %baseDir%\history\%year% (
rem mkdir %baseDir\history\%year%
rem )
mkdir %destinationDir%
taskkill /t /f /im cygrunsrv.exe
taskkill /t /f /im bandwidthd.exe
net stop bandwidthd
copy %sourceDir% %destinationDir%\
net start bandwidthd
@ECHO ON
|