Remove old backup files

  • Can anyone tell me in 2005 how you get it to automatically remove .bak files older than 1day, or 1week etc. after it's done the backup. I can't find the option...thanks

  • You can see some responses to this same question here (including my answer re-copied below):

    http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=146&messageid=275594#bm275806

    - I have not seen this option in the SQL 2005 "Maintenance Plan Wizard" but I have seen it in the "New Maintenance Plan" option instead.  So I have been creating Maintenance Plans with the wizard since it is more like what was in SQL 2000 and then I create a "New Maintenance Plan"- a Cleanup Backup plan to purge out the old backup files.

    In the "New Maintenance Plan" select the Maintenance Cleanup Task (on the left side).  Then in the Design tab that comes up, double-click the task to configure it, browse to the folder holding backups, specify backup extension (may need more than one plan if multiple extensions), and set the backup retention in the File Age section.  Click ok and Save Selected item under the File menu.

    You can also do similar to your original maintenance plan by adding this "Maintenance Cleanup Task" directly to your "Wizard-created" maiantenance plan - but I thought what I described above was more straightforward to start with..

    Hope it helps.

  • Thanks for that..The maintenance task thing seems to have turned up now!

    In the other thread someone talked about a box you check - "Include first-level subfolders."  I can't see this on mine.

    Otherwise you would need a maintenance clean up task for each sub folder assuming you keep your backups in separate folder - which would be silly

  • I haven't had need for that yet so I have not looked for it, but I thought that post said it was a fix in SP1.  You're using that now?

  • Oh I missed the bit about it being in SP1. When's that due?

  • It's available already:

    http://www.microsoft.com/sql/sp1.mspx

    In fact, I was reading that Microsoft is already planning hotfixes for SP1:

    http://weblog.infoworld.com/dbunderground/archives/2006/05/microsoft_plans.html

    If you are planning to upgrade (and not do a clean install) I would read other messages posted here and/or on Microsoft or even Google on some upgrade issues.  The areas I have used have not been problematic with the upgrade, but I know there are some known issues.. also partly the reason for the upcoming SP1 hotfix.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply