编写一个bat文件 @echo off rem @echo off rem 取1天之前的日期 echo wscript.echo dateadd(,date) >%tmp%\tmp.vbs for /f "tokens=1,2,3* delims=/" %%i in ('cscript /nologo %tmp%\tmp.vbs') do set y=%%i for /f "tokens=1,2,3* delims=/" %%i in ('cscript /n…
1.建立批处理脚本,c:\soft\demo.bat @echo off taskkill /F /IM nginx.exe > nul cd C:\soft\nginx-1.11.3 rem date格式:Wed 11/02/2016 set today=%date:~10,4%%date:~4,2%%date:~7,2% set dir=C:\nginxlog\%today% md %dir% rem access log move C:\soft\nginx-1.11.3\logs\acc…
默认 nginx 不支持 log自动分割 windows下 解决方案: 1.首先创建bat脚本 split_log.bat , 并保存在nginx 目录下: @echo off rem 查看系统中正在运行的nginx进程 rem tasklist /fi "imagename eq nginx.exe" rem 备份并根据时间重命名访问日志文件 NET STOP "nginx" set "cmdstr=move C:\nginx\logs\a…