|To backup the data in my application, I run a nightly dump of each database to a text (SQL) file that is zipped and archived in a directory. I need to start cleaning these up because I'm running out of disk space with 5 databases and a year's worth of daily backups.|
Ideally, I'd like to keep daily files for the last month plus 1 file per week before that. If possible, any data that's 6+ months old I would only keep 1 file per month, but that's optional.
For example, today is 12/22. I'd like to have daily files back through 11/22 (or 30 days if that's easier) plus the files from each previous Sunday. Anything from June or earlier I would only keep the last weekly backup file.
I have 1 directory per database, with the daily text files in it. I can run the process once per directory changing the directory name. The file names use the following convention:
Any idea how to accomplish this? Batch file, scheduled task, combination of the 2? Off the shelf software?
Let me know if I can provide any more info to clarify. Thanks in advance for your help.