7

My build agent working directories are starting to take too much space on the disk. I wonder if it is okay for me to delete some old folders, or if I should back them up.

What is the impact of deleting a TFS build agent working directory?

  • Are the labels affected?
  • Is the build history affected?
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
alexandrekow
  • 1,927
  • 2
  • 22
  • 40

2 Answers2

9

You can do it if your builds are not incremental (incremental get). If your builds always get all source files for every build it is OK to delete working directories. Build history and labels are not affected. Your build logs are in the drop location and it shouldn't be a problem either.

It is a problem for incremental (at least from incremental get) builds. These builds are getting only the latest changes from the TFS source control before every build, not the whole workspace as defined in the build definition's workspace.

Check your build definition's Process → CleanWorkspace settings. If it is set to All, it should not be a problem to delete the build directory.

Bernard Vander Beken
  • 4,848
  • 5
  • 54
  • 76
Ludwo
  • 6,043
  • 4
  • 32
  • 48
-1

Assuming I understand your question correctly, make sure you delete the builds through the TFS interface. Don't just delete the folders off the disk if you can help it. The TFS 2010 Build Deletion dialog gives you some options about what to keep and what to delete.

http://blogs.msdn.com/b/jpricket/archive/2009/12/09/tfs-2010-how-about-those-build-delete-options.aspx

You can also set up build retention policies so that old/unused builds automatically get deleted.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
BNL
  • 7,085
  • 4
  • 27
  • 32
  • I think he's talking about working folder on the build server, not the output directory. – itchi Apr 10 '12 at 18:10
  • If you wanted to extend this idea further, you could setup a script which looks at the last modified date of the working folder, then do a get specific changeset 1, and recursively delete the files in the working folder. Finally, create a windows scheduled task to run every week or so as the build agent. – Steve L. Jan 27 '14 at 18:48
  • The link is broken - *"This page has been disabled."*. – Peter Mortensen Jan 16 '19 at 15:00