5

We have a self-hosted TFS build agent which has run out of space so I would like to delete as many of the folders under the agent\_work and agent_dply\_work folders as possible, where they are > 1 month old.

Is this safe to do?

I have found this post on setting up cleaning, which I will certainly do.

Also found this post on cleaning the _work folder which recommends renaming, then deleting the whole folder, but not parts of it.

What I can't find is the maintenance settings for the agent pool, as described in this post. I'm wondering if this is in some control panel on the actual agent, because it does not appear to be in our settings. I looks for it under Project > Project Settings > Agent pools, for example:

https://COMPANY.visualstudio.com/PROJECT/_settings/agentqueues

Matt W
  • 11,753
  • 25
  • 118
  • 215

1 Answers1

17

It's safe to do this. Besides I would recommend you follow suggestion mentioned by TingluoHuang in second link.

Just need pay attention to follow:

Make sure there is no running job on the agent and stop the agent process/service first before delete/rename any folder

Actually, there is a setting related to configuring reoccurring maintenance (Organization Settings -> Agent Pools -> <Pool Name>-> Settings [tab]).

enter image description here

And then you could find related sett

You need first turn off Maintenance job. And then you will find related setting there.

enter image description here

Dharman
  • 30,962
  • 25
  • 85
  • 135
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • 1
    Thanks, but I have looked everywhere for that setting and can't see it. I'm not an admin in our system, however. – Matt W Oct 20 '20 at 14:23
  • same here, I am unable to find this setting ! – ManiVI Apr 19 '21 at 14:43
  • 3
    @MattW : this https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/pools-queues?view=azure-devops&tabs=yaml%2Cbrowser#what-is-a-maintenance-job helped me , this option is available under organization settings, not under project settings ! I was under project settings. – ManiVI Apr 19 '21 at 14:49