默認 nginx 不支持 log自動分割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"