Which directories on a Bamboo remote agent can be safely removed?

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

    

Summary

Sometimes it may be necessary to remove cached files from a Bamboo remote agent for a number of reasons ranging from general cleanup to removing old JAR files that are no longer wanted. This knowledge base article will talk about each directory and its contents that can be safely removed.

Solution

Before performing any removal of files on the remote agent, you should first shutdown the agent so it is offline.

$BAMBOO_AGENT_HOME/caches 

The contents of the caches directory can be safely removed while the agent is offline. It contains the plugin cache which will be regenerated upon next restart of the agent.

$BAMBOO_AGENT_HOME/temp

This is a temporary directory used for temp files for runtime operation of the remote agent. The contents of it can be safely removed while the agent is offline.

$BAMBOO_AGENT_HOME/build-dir/$JOB_KEY

The files here created by your Bamboo build/deployment plans and are not native to Bamboo. The build-dir is the working directory for a build/deployment and all build commands are executed out of here as a base. Bamboo does not cleanup these directories unless the plan is removed and its the builds responsibility to clean the directory. That can be done with either of these two options within the plan:

  • Clean working directory task or 
  • Plan Configuration >> Job >> Other >> Clean working directory after each build

Typically build working directories (if the build is not in progress) are ephemeral, can be deleted and most builds will happily recreate the contents, however if the build/deployment is written in a way that depends on previous state to be maintained within this directory between builds – it may fail on the next run. 

$BAMBOO_AGENT_HOME/build-dir/_git-repositories-cache

This is Bamboo's Git repository cache to speed up source-code checkouts. It can be safely removed while the agent is offline but means the next build that uses it may take longer to perform a source code checkout as it has to fetch the repository from a fresh state.

Last modified on Jan 26, 2022

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.