windows nginx日志切割

@echooff

ifnotexist"C:\nginx"gotodpan

setnginxpath=C:\nginx

setnd=C:

gotostart

:dpan

ifnotexist"D:\nginx"gotoepan

setnginxpath=D:\nginx

setnd=D:

gotostart

:epan

ifnotexist"E:\nginx"gotofpan

setnginxpath=E:\nginx

setnd=E:

gotostart

:fpan

ifnotexist"F:\nginx"gotofpan

setnginxpath=F:\nginx

setnd=F:

gotostart

:start

setnlog=%nginxpath%\logs

setnlogbak=%nginxpath%\logbak

ifnotexist%nlogbak%mkdir%nlogbak%

%nd%

cd%nginxpath%

setcmdstr=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/IMnginx.exe

call%cmdstr%

startnginx

相关推荐