@echo on
rem write to log
set filename=deletefile.log
echo -------------------Delete Expired Log Files------------------------- >>%filename%
echo Start >>%filename%
echo (%date% %time%) >>%filename%
echo Delete the expired log files in 目标目录路径1, Please wait... >>%filename%
rem forfiles.exe /p "D:\tomcat" /s /m *.log /d -4 /c "cmd /c del @path"
forfiles.exe /p "F:\daybak" /s /m *.bak /d -4 /c "cmd /c del @path"
forfiles.exe /P "F:\daybak" /M *.bak /S /C "cmd /c rar a -df e:\daybak\@file.rar @file"
forfiles.exe /P "F:\daybak" /M *.rar /S /d -7 /C "cmd /c del @path"
echo End >>%filename%
echo (%date% %time%) >>%filename%
时间: 2024-10-16 00:41:07