AzurLaneAutoScript icon indicating copy to clipboard operation
AzurLaneAutoScript copied to clipboard

定期清理冗余log

Open xuxuahe opened this issue 4 months ago • 2 comments

你的功能请求是否与问题有关?

因为多开的原因,我的log文件长期堆积文件导致多的爆炸,手动清理的话挺麻烦的,能新加一个定期清理log的操作么

Image

解决方案

No response

其他内容

No response

xuxuahe avatar Sep 05 '25 04:09 xuxuahe

手动删吧0. 0

q71998 avatar Sep 14 '25 08:09 q71998

用任务计划配合脚本可以实现,拿ai写了一个,可以试试,记得改文件夹路径

@echo off
rem 删除 D:\ALAS\log 下修改时间早于 7 天的文件(包含子文件夹)
forfiles /p "D:\ALAS\log" /s /m *.* /d -7 /c "cmd /c del /q @file"

rem 再尝试删除已经为空的文件夹
for /f "delims=" %%i in ('dir "D:\ALAS\log" /s /b /ad ^| sort /R') do rd "%%i" 2>nul

LostMyMind avatar Sep 15 '25 01:09 LostMyMind