README.txt 614 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
copied from http://www.davewentzel.com/content/dba-box-scripts


There are some changes I haven't gotten around to implementing in the last 10+ years. 
 
Someday...
 
we delete files from the sqlbackups folder using DOS dir after constructing the date parameters in TSQL.  This is wrong...if the agent wasn't running on a given day then those backups never get deleted.  Proper way is to use FORFILES in DOS. 
This command *should* delete files where the file modified date property is older than 3 days.

FORFILES /p d:\sqlbackups /s /m *.bak /d -3 /c "CMD/C del /Q /F @FILE"

This needs to be tested.