ProGet Documentation

Retention Policies

Each ProGet feed can have any number of automated retention rules defined. Each rule is executed in order during feed cleanup.

A ProGet Basic license is currently required to use feed retention. Although rules can still be configured in the free edition, they are always executed in dry run mode in ProGet Express.

Retention Rule Configuration

Every rule is evaluated independently, and works by excluding packages from consideration. Following is a listing of all possible filters:

Cached Packages Only packages that have been cached from a connector will be considered for deletion.
Prerelease Packages Only prerelease versions of packages will be considered for deletion.
Old Versions The highest N versions of every package are not considered for deletion; only lower versions are considered.
Unused Versions Only packages that have not been downloaded in the last N days are considered for deletion.
Download Count Only packages that have been downloaded the number of times specified or fewer are considered for deletion.
Matching ID Only packages that have an ID matching the specified filter are considered for deletion.
Non-Matching ID Packages that have an ID matching this filter are not considered for deletion.

If multiple filters are used, then only packages that meet all of the selected criteria are considered. See matching examples for more information.

Quotas

A rule can be defined to only run when a certain size threshold is reached. There are three possible quota configurations for a rule:

none No quota is defined; the rule will always delete every package that matches the rule's filters.
size of matching packages The user-specified size applies to the total size of all packages that match the rule's filters. The rule will only delete packages until the remaining matches consume disk space less than or equal to the specified size.
size of entire feed The user-specified size applies to the total size of all packages in the feed; even packages that do not match the rule's filters. The rule will still only delete matching packages, but it will do so until the size of the total feed is less than or equal to the specified size.

When a quota is defined, ProGet will only delete matching packages until the specified size is met. In determining which packages to delete first, it will use the following priority:

  1. Cached packages are always deleted first.
  2. Prerelease packages are considered if there are no more matching cached packages.
  3. Previous versions of matching packages are considered if there are no more cached or prerelease matches.
  4. All other matches are considered in no guaranteed order.

This delete order is implemented as a convenience and should not be relied upon to keep packages from being deleted. If you want to ensure a package is safe from retention, make sure that it will never be matched by a rule in the first place .

Dry Run Mode

On the Admin->Advanced Settings page is a FeedRetentionDryRun option. Setting this option to True will prevent any retention rules in ProGet from actually deleting anything. It will still run the rules as normal and log the packages that would be deleted if dry run mode was not enabled, but will skip the actual deletion.

This can be useful to evaluate whether a rule is correct before running it on a live feed.

Testing and dry run mode are not intended to be a substitute for a proper backup plan for your package repository. Packages deleted through retention are deleted permanently. Production environments should perform regular repository backups in case of any accidents.

Retention Rule Matching Examples

ProGet's retention rules are powerful enough to handle many use cases. This page will list some common scenarios and how to configure them.

Delete Cached Packages Not Downloaded in 30 Days

This will delete all packages cached from connectors that nobody has requested within 30 days of the time the rule is evaluated.

  • Check Delete cached connector packages
  • Check Delete unused versions and supply 30 days

Delete Previous Prerelease Versions

This will delete all prerelease versions of all packages, except for the most recent prerelease version.

  • Check Delete prerelease versions
  • Check Delete old versions and supply latest 1 version

Delete Old Versions of Specific Packages

This will delete all except the latest 5 versions of any packages matching the wildcard filter my.package.*

  • Check Delete old versions and supply latest 5 version
  • Check Filter by package name and supply my.package.* as the delete packages with matching IDs value.