-
Notifications
You must be signed in to change notification settings - Fork 870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: Safest way to manually clean the build agent's work folder #1895
Comments
@andmos here is what i would suggest:
|
@TingluoHuang - you want to make sure it's not in progress of a build right? Diable and then query not busy? |
Thanks @bryanmacfarlane
|
Cool. @TingluoHuang and @bryanmacfarlane! What we have tried before hand is this cleanup script:
So we remove all files older than 10 days. On the VSTS/AzureDevOps agent we this error: I guess that is because the folder itself was not deleted, only single files within? |
yes, i would not suggest you to change/delete file within your work folder. the agent can't handle that. |
@bryanmacfarlane don't know if you guys want to keep this issue up to update some documentation on the subject? I guess I'm not the only one who might be interested in the topic 😃 |
I am going to close this issue for now. :) |
Anybody who might land here again :D :D. Instead of manually cleaning "_work" folder, "maintenance" can be scheduled for the Agent/Pool. On running maintenance, following was observed(basis maintenance configuration):
P.S. : Follow at your own risk :) ;) |
@rishibamba How do you schedule maintenance for the Agent/Pool? I don't see any option in the UI for that ... |
@jklemmack |
FYI, this is what the Maintenance job UI looks like |
Looks like this is only available in tfs/azure devops server. |
The information provided above was given on checking "Azure DevOps Services". Still available at the path mentioned. |
Not available for Azure Devops Server 2019 |
|
Note that there's a different in available options between the Project Settings and Collection Settings screens. This was available to me when going through Collection Settings but not Project Settings. |
Since running pre-cleanup-jobs ( I have created https://github.com/EugenMayer/azure-agent-self-hosted-toolkit which fixes this project on the agent-level, not requiring any changes to the pipelines nor relying on those. To quote to project idea
This repository also offers a toolkit to start / setup x-agents and maintain them using the original tools of Microsoft, but wrapped in convenient scripts. If this helps anybody else, happy to share it. |
Is there also a way to do this for environments or deployment groups? |
Have you tried trouble shooting?
Trouble shooting doc
Agent Version and Platform
Mainly
1.95.3
but also
2.123.0
Windows Server 2012 / Windows Server 2016
VSTS Type and Version
On-Prem TFS
Tfs2015 Update3
What's not working?
This is more a question.
We run on-prem TFS2015 agent with the old
1.95.3
agent and have a LOT of repositories.We haven't found any way to do global retention settings on the build agents, so the disk fills up over time.
Until know we have recycled the build servers themselves now and then, but sometimes we need to do manual cleanup on the agents themselves. I'm just wondering what is the safest way to manually clean out the agents of old builds?
Is it OK to delete stuff under
_work
, or does folders like_tasks
need to be handles with care?We are also running a few agents in the old VSTS (now AzureDevOps I guess) on version
2.123.0
, can the same cleanup strategy be used here in a pinch?The text was updated successfully, but these errors were encountered: