SQL Server 2005 cleanup of old backups is not happening

  • Hello,

    I have set up a cleanup task to keep only the last 5 days of database backups and transaction log backups, yet when I check the directory, older files are still there. As a result, over time the directory fills up and I have to clean it up manually.

    Does anyone know why this is happening, or how I can find more details to help resolve the problem?

    Thanks for any help!

    ---

    webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • What I did was to set up an date that the backup expires in the backup routine for the backups. The transaction logs are 24 hours, the differentials are 7 days and the full backups are 28 days. Then the files are automaticly removed because the cleanup seems to sometimes fail but I still have the cleanups there to remove anything older that 4 weeks on the .bak files and 3 days on the .trn files just as insurance.

  • Which service pack are you on?  Before SP2 the cleanup task would not correctly cleanup subdirectories.

  • We are on SP1. SP2 had some trouble so we have not moved to it yet.

    I ended up writing a T-SQL procedure to do the deletions, based on an example I found here:

    http://www.webservertalk.com/archive132-2006-10-1716136.html

    ---

    webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

Viewing 4 posts - 1 through 3 (of 3 total)

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