Maintenance cleanup task not deleting old files

  • Hi folks,

    I have created some cleanup tasks within maintenance plans to clear old backup and TRN files and nothing seems to be done... where are the logs for this cleanup task?

    Have I forgotten something

    Much appreciated

  • Look at the properties of your plan, everything is in there.

    Are you sure you specified the right path and extension for the files you want to purge?

    ...how about the scheduling?

    ...how about of the age of the files you want to purge?

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Yep ... age and path are correct

    Is there and agent that is supposed to run for this?

    This cleanup is not working in 2 maintenance plans

  • Maintenance Plan should generate a Job, Job is executed by SQL Server Agent.

    SQL Server Agent service must be up.

    Check Job looking for the step that should run the Maintenance Clean up Task... if Clean Up task was added later to the Maintenance Plan you might find the step is not part of the Job.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • Actually I did add later after the pans were created and the green links are there

    server agent is indeed active

  • Look at the history of the Job...

    Check if the step is actually there and in the affirmative case if it runs or not.

    If step is not there you have to re-create the job.

    If step is there and runs... you have somthing wrong, either file path or extension.

    _____________________________________
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at Amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
  • I see it as part of a maintenance plan in the history log ( log file viewer) but nothing else.

    Very frustrating

  • I even created a new plan and executed it manually and the files do not get deleted.

    Very strange

  • What build version of SQL 2005 are you currently on?

    You said...

    This cleanup is not working in 2 maintenance plans

    So does this mean other cleanup tasks are working? Are all backup files located on the same drive & folder structure? Could it be a permissions issue?

    Mark

  • One of my cleanup tasks was not working because I had the file suffix as .bak including the dot.

  • I had to create a separate maintenance plan and the suffix was also wrong ... apparently it's a bug in sql 2005.

    Now it works

  • Here is something to check:

    Navigate to SQL Server Agent | Jobs. Look at the properties of the Maintenance plan's subplan. Verify that the Owner has permission to delete the files in the backup folder. If not, you can change the owner of the job to a Login with Windows authentication that has the required privileges on the folder.

  • Thanks for that tip !

  • didi77 (8/6/2012)


    thanks, I have also put a dot before the "bak" and so it didnt work with ".bak" but clear witch "bak"

    Sorry for the up of this post, but it was helpfull ;).

Viewing 14 posts - 1 through 13 (of 13 total)

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