The contents of the Windows under Bat script file are
1. Delete all files up to 5 days before the specified path
.
@echo offset Srcdir=e:\work\gitset daysago=5forfiles/p%srcdir%/s/m *.*/d-%daysago%/C "cmd/c del/f/q/a @path"
2. Delete all log files up to 5 days before the specified path
@echo Offset Srcdir=e:\work\git//specified path: 5 days ago Set daysago=5//5 days ago forfiles/p%srcdir%/s/m *.log/d-%daysago%/C "Cmd/c del /f/q/A @path "
*.log to filter the file format, also if you delete jpg picture format file, here can be replaced by . jpg
3. Windows timed to run BAT file
1) in WIN10 system, select Computer Management-"System Tools-" Task Scheduler, create tasks
2) in the "Create Task" box that pops up, the general settings
3) in the trigger-"new, and set the time and frequency of the scheduled operation
4) operation-"New-" open the well-written bat script file and click OK to save
Then return to the Computer Management interface, the System Tools-"Task Scheduler-" Task Scheduler can find the "Timed automatic deletion" task.
Windows periodically deletes log files that are n days before the specified path