Project-related clean-up settings are configured in the Project Settings (prior to TeamCity 9.0, the Server Administration | Clean-up Settings section was used).
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.
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.
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:
- 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.