files getting deleted from agent work directory

Is it normal for the build agent to delete any files from the work directory that are not from the agent itself?

I've had files in the buildagent\work directory before for various purposes... and every now and then they'd mysteriously disappear.  Today I saw it after I rebooted the box.  Entire directories and contents would disappear.

Is the build agent deleting files on startup?

TC 3.1 on Windows 2003

3 comments
Comment actions Permalink

Hello,

  TeamCity's build agent work directory is under build agent control, so the files can be cleaned from it.

  If you wan't to make sure that TeamCity never cleans any files in your target working directory, you should handle
  checkout process without TeamCity assistance and set "Do not checkout files" in VCS settings section for the build
  configuration.
 
  Regards,
  KIR

0
Comment actions Permalink

These are not files in the checkout directories - these are files in their own directories


agenthome
  - bin
  - work
      - asdfasd43434
      - asdfa48844
      - 24548sadfdsf
      - testdirectory


In the example above, testdirectory gets deleted when the agent restarts.  This seems totally unrelated to VCS checkout settings because this 'cleanup' only seems to happen on agent startup.  We were pulling our hair out trying to figure out what happened to some data being retained in this manner.  One day it just disappeared, and no one deleted it.  Then yesterday, while working on the server's console, I restarted the agent, and watched as several directories just disappeared right before my eyes.

I understand a work directory should not be considered safe storage, but I'm asking if this was the intended behavior?  I've since changed my scripts to move our retained data elsewhere (to the agent home directory).. I just hope its safe there!!

0
Comment actions Permalink

Hello,

TeamCity monitors the directories in the work directory and removes all unrelated stuff.

This was done to automatically free disk space when some of build configurations/checkout
directories are not used anymore. So any directory which wasn't updated/used by TC within 2 weeks
will be removed. Your dir is unknown to teamcity, so it was removed.

Regards,
KIR

0

Please sign in to leave a comment.