Wednesday 30 October 2013

Adding SQL Maintenance Cleanup Task

This article is a follow up on Creating a Simple SQL Maintenance Plan where we added a Maintenance Cleanup Task in our maintenance plan. This will show you the steps on how to add a maintenance cleanup task in order to house keep our backup files.


  1. Drag a Maintenance Cleanup Task from toolbox. Double click to edit properties.
  2. In properties window we can set which folder to watch and what is the file extension. We can also set the number of days, weeks, months or years on how long SQL needs to keep the files.
  3. Maintenance Cleanup Task Properties




















  4. Click OK button to save settings.
  5. Sample Maintenance Cleanup Task


















In the above example, the Maintenance Cleanup Task will delete all backup files (with bak as file extension) that are older than 4 weeks from the selected folder in the properties window.




No comments:

Post a Comment