taskkill /im nginx.exe /f
D:
move D:\heshuan\nginx-1.17.7\logs\access.log D:\heshuan\nginx-1.17.7\backuplog
move D:\heshuan\nginx-1.17.7\logs\error.log D:\heshuan\nginx-1.17.7\backuplog
cd D:\heshuan\nginx-1.17.7\backuplog
del /f /s /q "access%date:~0,4%-%date:~5,2%-%date:~8,2%backup.log"
del /f /s /q "error%date:~0,4%-%date:~5,2%-%date:~8,2%backup.log"
rename access.log "access%date:~0,4%-%date:~5,2%-%date:~8,2%backup.log"
rename error.log "error%date:~0,4%-%date:~5,2%-%date:~8,2%backup.log"
cd D:\heshuan\nginx-1.17.7
start nginx.exe
for /f "tokens=1-5 delims= " %%a in ('"netstat -ano|findstr "^:8089""') do taskkill /pid %%e
for /f "tokens=1-5 delims= " %%a in ('"netstat -ano|findstr "^:8088""') do taskkill /pid %%e
E:
cd E:\ygt2
call start.bat
cd E:\ygt3
call start.bat
bat文件启动或关闭其它windows服务
版权声明:本文为weixin_42502300原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。