I am working on creating a small script that will help me clean up a backup folder. Currently the backups are done nightly at 10 pm.
I would like to trim files somewhat like this;
-Keep each day for 4 weeks
-Week 5 to lets say 26 keep only first day of week backups (Mondays)
Week 27 to week 52 keep only first day of the month. (i might not keep this last clean as weekly might leave me enough room).
One small issue we have is some days the backup is doubled. This is an issue from the vendor and cannot be fixed at this time, so I would like to delete backups that have more than 1 backup in day. I guess this can be performed before the other checks and trimming.
I was wondering if there is anything similar already out there that can give me a starting point or if anyone can help me with small bits of this?