AIC-Admin
asked on
SQL 2005 DB Backup Doesn't Remove Old Backup Copies
I used SQL Server Management Studio Maintenace Plan wizard to create a backup job that backs up a database nightly to a network location and is working as planned. My issue is that it creates a new .bak file with each backup (as I want it to) but after running for two weeks I have 14 .bak files. Is there an easy way to have the job also delete old .bak files that are older then 7 days?
I don't know any SQL scripting or coding so if there is a way to do this from the GUI that would be ideal.
Thanks in advance!
I don't know any SQL scripting or coding so if there is a way to do this from the GUI that would be ideal.
Thanks in advance!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am sure that I could ask our SQL programmer to do write a SSIS package but I was trying to just finish the task myself. I know I can delete them via explorer but the idea is automation so I don't have to manually delete the files or worry about forgetting to clean them up and eating up disk space.
I will check the "Maintenance Cleanup Task" that buttercup1 suggested... I must have totally over looked that. Thanks
I will check the "Maintenance Cleanup Task" that buttercup1 suggested... I must have totally over looked that. Thanks
ASKER
Since I already had the plan in place I just added a Subplan to run the Maintenance Cleanup Task and set it to delete files with extension bak from the network backup location that are older then 7 day(s). Thank you for the guidance!
You're welcome!
You could add code into the backup maintenance plan (it's an SSIS package) to delete any files older than 7 days - is there someone in your organisation who writes SSIS packages?