Maintenance Plan for clean up old backup

  • Hi,

    I created a simple Maintenance plan to delete .bak file older then 7 days and .dif file older then 2 days.

    The job created by this maintenance plan history says job ran successfully but backups files are still there. Is anyone come across this issue ? Any idea ? Any suggestion ?

    Cheers,

  • When you specify that it should delete .BAK files, do not inlude the "." (dot, or period) in the extension .... just BAK

  • Yes. Most likely you would have entered .BAK. This is one of the changes in SQL Server 2005 from SQL Server 2000

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • Thanks for reply guys,

    Yes I am aware about that and I entered bak and dif without dot.

  • @ msn

    This is the biggest drawback of maintenance plans. It happens many times.

    check whether the sql agent has access to that backup directory?

    Also, look out for Maintenance plan logs or sql server logs.

    What does it tell there ?

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • @msn29,

    Does the backup task has "Create a sub directory for every database" option selected? If yes, then the "Include first-level subfolders" option needs to be selected in Maintenance Cleanup Task

    Pradeep Adiga
    Blog: sqldbadiaries.com
    Twitter: @pradeepadiga

  • I have the same problem. I changed BAK to bak, then it works.

  • Thanks guys,

    Sorry for late reply as it seems like we are in different time zone.

    @skybvi

    yes I checked SQLAGent have access to backup directory.

    There is no detail in maintenence plan history.

    @Adiga

    yes the option for first level folder is selected.

    Also tried BAK replcae with bak

    Any other idea ?

    Cheers,

  • @ msn

    If the subfolders option is selected, then you have to mention that individual folder in the maintenece clean up task.

    Did you do that?

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • What SP is SQL Server at? It was a bug in RTM and I think also SP 1 that the Maintenance Cleanup would did not work. You need to have SQL at 9.00.3042 or higher.

    Select @@version will supply this information

    Chris Powell

    George: You're kidding.
    Elroy: Nope.
    George: Then lie to me and say you're kidding.

  • Hi Chris,

    Current version is Microsoft SQL Server 2005 - 9.00.4262.00 (X64)

    Enterprise Edition (64-bit) on Windows NT 5.2 (Build 3790: Service Pack 2)

    Cheers,

Viewing 11 posts - 1 through 10 (of 10 total)

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