Merge branch 'server-2008' of http://162.14.101.3:3000/wsh5485/CLEAN_EVERYTHING into server-2008

This commit is contained in:
2025-01-16 11:09:45 +08:00
+8 -4
View File
@@ -3,7 +3,7 @@ chcp 65001 >nul
setlocal enabledelayedexpansion
REM 设置目标目录
set TARGET_DIR=e:\path\to\your\logs
set TARGET_DIR=E:\pythontest\CLEAN_EVERYTHING\新建文件夹
REM 设置日志文件路径
set LOG_FILE=%~dp0clean_logs_history.log
@@ -24,13 +24,17 @@ if not exist "%TARGET_DIR%" (
)
REM 初始化变量
set /a TOTAL_SIZE=0
set /a FILE_COUNT=0
set FILE_COUNT=0
set TOTAL_SIZE=0
set TOTAL_SIZE_MB=0
REM 清理.log文件
for /r "%TARGET_DIR%" %%f in (*.log) do (
set /a FILE_COUNT+=1
for %%s in ("%%f") do set /a TOTAL_SIZE+=%%~zs
for %%s in ("%%f") do (
set FILE_SIZE=%%~zs
set /a TOTAL_SIZE_MB+=FILE_SIZE/1048576
)
echo 删除文件:%%f >> "%LOG_FILE%"
del /f /q "%%f"
)