默认 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\access.log C:\nginx\logsHis\access.%date:~0,4%-%date:~5,2%-%date:~8,2%.log
call %cmdstr%"
rem 备份并根据时间重命名错误日志文件
set "cmdstr=move C:\nginx\logs\error.log C:\nginx\logsHis\error.%date:~0,4%-%date:~5,2%-%date:~8,2%.log
call %cmdstr%"
rem re-opening log files
NET START "nginx"

  

 2、 创建计划任务
 
     1)
windows 下 nginx log 分割
2、
windows 下 nginx log 分割
 
3、
windows 下 nginx log 分割
 

 
 
 
 
 





相关文章:

  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-07-21
  • 2021-07-12
  • 2021-09-04
猜你喜欢
  • 2021-10-22
  • 2022-12-23
  • 2022-01-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案