.BAK files cleaning up after themselves

  • Hello all. I'll probably know my answer by FRI but thought I'd ask and see if anyone here has actually seen it work. I created a MAINT JOB to backup my DB. Daily it's creating a *.BAK file in my "secure" (LOL) directory. I configured it in SQL to only keep 7 days of my .BAK files. My question. After 7 days will it go in my directory and delete the file from 7 days ago?

    I'm running SQL 2005 🙂

  • Yes. If the maintenance job is backing up directly to your "secure" directory, then it will purge .bak files older than 7 days.

    _________________________________
    seth delconte
    http://sqlkeys.com

  • AWESOME! Thanks for the reply. Now if there are files in there from a month ago is it smart enough to delete files 7 days and older and BEYOND? I have files in there from 2 months ago. I want to see if it will delete everything that's in there older than 7 days.

    Again thanks for the speedy reply.

  • I think it won't delete backups that were made from a different backup job, but I could be wrong. If it won't, you can create a cleanup script to do this:

    http://www.mssqltips.com/sqlservertip/1324/maintenance-task-to-delete-old-sql-server-backup-files/[/url]

    _________________________________
    seth delconte
    http://sqlkeys.com

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

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