Retention Rules

Enabling and Configuring Retention / Lifecycle policies

Automated retention/lifetime rules (available on the Velocity plan and above) allow you to automatically manage storage for packages by deleting or moving packages that fall outside of the defined retention rules. Assets can be expired based on the number of packages (count), the size of packages (bytes), or the number of days (time).

To enable and configure retention/lifecycle rules, click "Artifact Lifecycle" in the lefthand menu on a repository detail page, then use the sliders to set your policy, and finally click the green "Enable Lifecycle" button.


Enabling Retention / Lifecycle policy

The retention rules are disjunctive, so it uses all three to select what to delete. Packages are deleted based on the date pushed, starting with the oldest.

If grouping is selected, it applies to the rules to each "grouping". Otherwise, it's across all packages within a repository.

If “Group Packages by Name” is selected, retention will apply to groups of packages by name rather than all packages. For example, when retaining by a count limit of 1 and you upload PkgA 1.0, PkgB 1.0 and PkgB 1.1; only PkgB 1.0 is deleted because there are two (2) PkgBs and one (1) PkgA

If “Group Packages by Format” is selected, retention will apply to packages within package types rather than across all package formats. For example, when retaining by a limit of 1 and you upload PythonPkg 1.0 and RubyPkg 1.0, no packages are deleted because they are different formats

Example - Retention Policy that deletes packages older than 90 days

To configure a retention / lifecycle policy that removes packages older than 90 days, you would set the following:

  • "Limit By Days" = 90
  • "Limit By Count" = 0 (disabled)
  • "Limit By Size" = 0.0B (disabled)

By disabling count and size, it means it only uses the package age to delete


90 day Retention Policy


Retention rules only activate when packages are uploaded (synchronised). So you could have one package at 1000 days, and the 90 days retention still wouldn't activate. Only after uploading a new package would the 1000 day package be deleted.

Cloudsmith is the new standard in Package / Artifact Management and Software Distribution

With support for all major package formats, you can trust us to manage your software supply chain.

Start My Free Trial Now
Cookie Declaration (Manage Cookies)