`

windows nginx日志切割

阅读更多
@echo off
if not exist "C:\nginx" goto dpan
set nginxpath= C:\nginx
set nd=C:
goto start
:dpan
if not exist "D:\nginx" goto epan
set nginxpath= D:\nginx
set nd=D:
goto start
:epan
if not exist "E:\nginx" goto fpan
set nginxpath= E:\nginx
set nd=E:
goto start
:fpan
if not exist "F:\nginx" goto fpan
set nginxpath= F:\nginx
set nd=F:
goto start
:start
set nlog=%nginxpath%\logs
set nlogbak=%nginxpath%\logbak
if not exist %nlogbak% mkdir %nlogbak%
%nd%
cd %nginxpath%
set cmdstr= move %nlog%\access.log %nlogbak%\access%date:~0,4%%date:~5,2%%date:~8,2%%time:~0,2%%time:~3,2%%time:~6,2%.log
taskkill /F /IM nginx.exe
call %cmdstr%
start nginx
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics