Clean-up in TeamCity is a feature allowing automatic deletion of data belonging to old builds.
Since TeamCity 9.0, projectProject-related clean-up settings are configured in the Project Settings (not in the Server Administration | Clean-up Settings section like in previous versions).
The general clean-up configuration is available in the server Administration | Clean-up Settings.
The server settings are configured on the Administration | Server Administration | Clean-up Settings.
Since TeamCity 9.0, the The build history clean-up is run as a background process, which means that now there is no server maintenance down-time.
If you use the HSQL database, there is a short period of server unavailability when the HSQL database is being compacted.
Depending on the amount of data to clean up, the process may take significant time, during which the server might be less performant. Therefore, it is recommended to schedule clean-up to run during off-peak hours. By default, TeamCity will start cleaning up daily at 3.00 AM. It is also possible to run it manually.
You can also specify the time limit for the clean-up process. In case not all the data is purged within the time-frame specified, the remaining data will be removed during the next clean-up process.
With clean-up enabled, TeamCity will keep the server audit records for a year (365 days) by default.
Manual Clean-up Launch
The Previous clean-up section of the server clean-up settings enables you to:
Clean-up rules are configured per project and define when and what data to clean. Different rules can be assigned to a project and templates or build configurations within this project.
To manage the rules, use the Project-Settings | Clean-up Rules. The Clean-up Rules page allows assigning different rules to a project, and the templates or build configurations within this project.
The following inheritance rules apply:
When both conditions are specified, only the builds which must be cleaned according to all rules will be actually removed: TeamCity finds the oldest build to preserve according to each of the the rules and then cleans all builds older than the oldest one of the two found.
- Artifact patterns. The artifacts matching the specified pattern will be included in/excluded from the clean-up. Use newline-delimited rules following Ant-like pattern. Example: to
- to clean-up artifacts with 'file' as a part of the name, use the following syntax:
- to exclude
*.jarartifacts with 'file' as a part of the name from clean-up, use
- pinned builds;
- builds used as a source for artifact dependency in other builds when the "Prevent clean-up" option for dependency artifacts is enabled. See Clean-Up for Dependent Builds below. Such builds are marked with icon in the build history list;
- builds used as snapshot dependency in other not yet deleted builds;
- builds of build configurations that were deleted less than one day ago.
TeamCity always preserves builds which are used as snapshot dependencies in other builds. These builds are not deleted from builds history by the clean-up procedure until dependent builds are deleted. Artifacts of these builds can be deleted based on the option below.
TeamCity can optionally preserve builds and their artifacts which are used in other builds by artifact dependencies.