ENHANCEMENT - Maintenance Cleanup Task and SP1

Maintenance Cleanup Task is a new feature available in SQL 2005 which can be used to remove files related to Maintenance Plans. You can learn more about it at this article - https://msdn2.microsoft.com/en-us/library/ms345177(SQL.90).aspx

SQL 2005 RTM (32bit and 64bit)

In SQL Server 2005 RTM, the Maintenance Cleanup Task doesn't allow you to delete maintenance plan files from subfolders. As per BOL:

In contrast to earlier versions of the Maintenance Cleanup task, the SQL Server 2005 version of the task does not delete files in the subdirectories of the specified directory. This constraint reduces the surface area of any attack that may exploit the functionality of the Maintenance Cleanup task to delete files maliciously.

Service Pack 1 Enhancements

However, this limitation means that you have to create a Maintenance Cleanup Task for eachfile that you want to delete. This could be inconvenient if you have many databases on your server and you back them up under different sub-folders.

With the launch of service pack 1, Microsoft has removed this restriction. Now, you have to check the checkbox against "Include first-level subfolders" in the Maintenance Cleanup Task to delete folders under sub-directories.

This has been highlighted in in the KB https://support.microsoft.com/kb/916940/#EQADAAA

Comments

  • Anonymous
    June 04, 2006
    It only partly works unfortunately....

    You have to do . in the file type as *.bak just doesn't delete anything!

    Simon

  • Anonymous
    August 28, 2006
    Simon, you can create 2 Maint Cleanup
    one time for *.bak and the second for *.txt
    this task is for cleaning backups and not for enithing else ;)

  • Anonymous
    November 09, 2006
    My experience is that Simon is correct. If *.bak is used as a File extension then they won't be deleted. Only . seems to work.

  • Anonymous
    November 23, 2006
    The damm thing doesn´t delete anything at all, although I set . or * as file extension.

  • Anonymous
    June 01, 2009
    PingBack from http://paidsurveyshub.info/story.php?id=76374