定期删除30天前日志

cd /D D:\hosting\Log
dir /b /s /a:d>123.txt
@findstr   "W3SVC" "123.txt">d_name.txt
@findstr   "log" "123.txt">>d_name.txt
del 123.txt
for /f %%i in (d_name.txt) do ( 
 
forfiles /p "%%i" /m *.log /d -30 /c "cmd /c del /f @path"

)
pause
#forfiles /p "D:\hosting\Log\yimei86.com\W3SVC74" /m *.log /d -10 /c "cmd /c del /f @path"

你可能感兴趣的:(it)