SQL Server Maintenance Plan: Cleanup Task

Hram Admin 0 Reputation points
2024-05-17T09:41:25.65+00:00

Hello!

Some time ago I noticed that my two maintenance plans were working incorrectly: the cleanup tasks that must have been deleting files older then 2 weeks had not been really deleting anything and my oldest files were ~29.02.2024. The reason was that I haven't check the "Include the first-level subfolders checkbox - right after checking it and re-runing the task the files older then two weeks have been deleted.

Nevertheless, now I started seeing the files older then two weeks once again:

00

The cleanup task that doesn't work is the final task of the MP:

Task1

If I create exactly the same task as the "single-tasked MP"Task2

...and execute it - all works perfect (today is 17.05.2024):
Result

Why does the cleanup task work when the task is in the separate MP and does not work when it is one of 4 tasks in a MP ?

Thank you in advance,
Michael

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,946 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 41,806 Reputation points
    2024-05-17T18:01:54.44+00:00

    When do the cleanup task start?

    It takes the age for very serios, the file are age of 13 day and 23:39 hour old, the files won't be deleted; of course.

    1 person found this answer helpful.

  2. ZoeHui-MSFT 33,941 Reputation points
    2024-05-20T05:35:32.98+00:00

    Hi @Hram Admin,

    Please have a check if the files will be cleaned on 05/18?

    Like Olaf said, it may need to follow Strict 24-hour.Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments