Delete old self-hosted VSTS build agent _work folders
Asked Answered
S

1

7

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

Stoller answered 20/10, 2020 at 11:7 Comment(1)
Yes, it's safe.Kronos
I
19

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

Issuance answered 20/10, 2020 at 14:21 Comment(4)
Thanks, but I have looked everywhere for that setting and can't see it. I'm not an admin in our system, however.Stoller
same here, I am unable to find this setting !Nocturne
@MattW : this learn.microsoft.com/en-us/azure/devops/pipelines/agents/… helped me , this option is available under organization settings, not under project settings ! I was under project settings.Nocturne
Agree not easy to find. Go to the absolute root for your TFS, eg. company123.visualstudio.com then look at the very bottom left corner of the screen for Organization settings. Then click Agent pools on the left and Settings on top.Nicoline

© 2022 - 2024 — McMap. All rights reserved.