Avatar of UConn
UConn
Flag for United States of America asked on

Query regarding backup maintenance plans

I am in the process of creating backup maintenance plans my databases. In the data flow task, I’ve placed a ‘Maintenance Cleanup Task’ that follows ‘Backup Database Task’ .  In the ‘File age’ section, I only see an option of deleting files older than ‘n’ number of hours, days, weeks, months or years. Is there a way to delete files older than ‘n’ number of files?
Any suggestions are appreciated.
Thanks!
Microsoft SQL ServerMicrosoft SQL Server 2008SSIS

Avatar of undefined
Last Comment
Alpesh Patel

8/22/2022 - Mon
Matt Bowler

No there isn't.

The assumption here is that because backups are being taken on a weekly/daily/hourly... basis then they should be cleaned up as such too. This logic falls over slightly if you take adhoc or out of band backups by manually running the jobs (which is often what you do when you set up the plans).

As a general rule - if you take daily backups and want to keep only 7 files then clean up files older than one week....
ASKER CERTIFIED SOLUTION
Armand G

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Alpesh Patel

Using Filesystem task, you can count the files with some predefined name and delete based on that.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy