Windows自動清理日誌腳本tomcat
查找7天前日誌文件壓縮備份後並刪除。bash
@echo off color 1f echo 正在壓縮備份7天前日誌... serverNode forfiles /P d:\tomcat1\logs /D -7 /M *.log /C "cmd /c d:\logClean\rar.exe a d:\logClean\logbak\tomcat1_%date:~,4%-%date:~5,2%-%date:~8,2%.rar @path && del @path"
把腳本放到計劃任務中天天執行。工具
RAR壓縮工具下載:https://download.csdn.net/download/mlm588/11261101.net