Backup file not deleting

  • Hi,

    I have a maintenance plan in SSMS which has 2 steps:

    1. Backing up a database on other server.(backup database task)

    2. Deleting the older backup files.(maintenance clean up task)

    The job runs fine everyday with the bak file in its place but

    the older backup files does not delete automatically

    I have to do it manually everyday.

    What is the problem?

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • Depending on version, you need to specify the extension to delete as BAK not .BAK

    I think this was fixed in a service pack if I remember correctly.

  • Are you post SP2 + SPs? There were some fixes for plans.

    What are your deletion settings?

  • @NJ-DBA

    The version is windows server 2003 with sp2

    the file extension i mentioned is bak

    @steve-2

    Windows server 2003 with sp2

    The delete settings are :-

    Delete files with extension bak and older than 1 day

    the folder is specified at same location as the backup location.

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • what version of SQL Sever?

    Can you perform "Select serverproperty('productlevel')

  • @ nj- dba

    Its

    9.00.4053.00 SP3 Standard edition

    Regards
    Sushant Kumar
    MCTS,MCP

  • Could you check for any errors in the MP logs.

    Thank You,

    Best Regards,

    SQLBuddy

  • @sqlbuddy

    wats MP logs?

    are you referring sql server logs??

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • Maintenance Plan Logs ... check this folder

    C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG

    Thank You,

    Best Regards,

    SQLBuddy

  • @sqlbuddy

    The output is :

    NEW COMPONENT OUTPUT

    Microsoft(R) Server Maintenance Utility (Unicode) Version 9.0.4053

    Report was generated on "server name".

    Maintenance Plan: job_name@10pm

    Duration: 00:00:00

    Status: Succeeded.

    Details:

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • You don't find any errors in that Log?

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

    Thank You,

    Best Regards,

    SQLBuddy

  • @ sql buddy

    If the agent didn't had access to the backup directory, then how could the backup be placed everyday?.... correct me if iam wrong

    The backup happens everyday but the deleting part doesn't happen.Thts strange indeed.

    Its like 2 parts of a job where 1st part is completed everyday and the other part is incomplete everyday and still the job is successful.

    Regards,

    Sushant

    Regards
    Sushant Kumar
    MCTS,MCP

  • Right. Do you have the backups of these dbs going into individual folders ?

    Thank You,

    Best Regards,

    Varma

  • That's the agent log, isn't it? You want to get something from the maintenance plan itself, not the job. Something like this:

    Maintenance Cleanup Task (SEVENFALLS)

    Maintenance Cleanup on Local server connection

    Cleanup Database Backup files

    Age: Older than 1 Days

    Task start: 2010-09-03T16:24:48.

    Task end: 2010-09-03T16:24:49.

    Success

    Command:EXECUTE master.dbo.xp_delete_file 0,N''C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Backup'',N'''',N''2010-09-02T16:24:48''

    You can configure logging in the plan. In there, set it to log to a text file.

  • In your maintenance plan, how are the two tasks connected?

    And, verify that you have configured the maintenance cleanup task with the correct directory and extension. As was previously mentioned - the extension cannot be .BAK - in other words, if you have the period in their it won't work.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 15 posts - 1 through 15 (of 44 total)

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