Cleanup Policies

Cleanup removes files, applications, and configurations to free up storage and improve system performance. Regular cleanup helps optimize disk space and maintain system efficiency.

Artifactory_Cleanup.png

JFrog cleanup policies remove stale data based on specific criteria. Platform and Project Administrators define custom cleanup policies to identify package, release bundles, or builds that are candidates for removal. This automates cleanup processes that align with organizational needs by customizing these policies.

Key Benefits

  • Improved Efficiency

  • Optimizes platform performance and loading times.

  • Enhanced User Experience

    Simplifies navigation by reducing the number of items, saving time and improving overall user experience.

  • Reduced Storage Costs

    Frees up storage space by removing unnecessary items, helping to reduce costs.

Prerequisites

  • Subscription: See the Subscription Information note in the Overview below.
  • Administrator Access: Platform or Project Administrator

  • Project Context

    • Platform Admins can manage cleanup policies globally across all projects or for specific projects.
    • Project Admins can manage policies within their project scope, with visibility into global policies affecting their projects.

Cleanup Policies Overview

There are 3 types of cleanup policies:

  • Package Cleanup Policies define which Packages to delete.
  • Release Bundles V2 Cleanup Policies define which Release Bundles V2 to delete.
  • Build Cleanup Policies define which Builds to delete.

For supported package types, refer to Cleanup Supported Packages.

📘

Subscription Information

  • Packages cleanup policies are supported on the Cloud (7.98.2) and Self-Hosted (7.98.7) platforms, with an Enterprise+ or Enterprise X (7.139.1 SaaS) license.
  • Release Bundles V2 Cleanup policies are supported on the Cloud (7.104.2) and Self-Hosted (7.104.5) platforms, with an Enterprise+ or Enterprise X (7.139.1 SaaS) license.
  • Builds Cleanup policies are supported on the Cloud (7.125) and Self-Hosted (7.125) platforms, with an Enterprise+ or Enterprise X (7.139.1 SaaS) license.
📘

Note

When you clean up Packages, Builds and Release Bundles (RB V2) that have associated evidence, the evidence is also permanently deleted.

Running Cleanup Policies

You can schedule hourly, daily, weekly, or monthly execution of a cleanup policy. You can also define time periods when execution is stopped. This enables you to perform cleanup during weekends or maintenance windows.

If required, you can run the cleanup policy manually. To learn more, refer to the Run Cleanup Policy Manually

As the cleanup process progresses, the system generates detailed logs in the Artifactory service logs.

Cleanup Limitations

The following limitations currently apply when you run a Packages Cleanup Policy:

Supported Repositories

  • Supports Local and Federated repositories. Does not support Remote and Virtual repositories.
📘

Note

When cleaning Federated repositories, the run (dry or actual) can take significantly longer compared to Local repositories. This is because the cleanup workflow must check the last download status of each package across all federation members. The more members involved, the longer the process will take.

Recommendations to Optimize Cleanup:

  • Adjust Policy Conditions: Narrow the scope of your cleanup policies to reduce the number of packages to be deleted in each run. This can significantly speed up the run.
  • Increase Run Frequency: Run cleanup policies more often to process smaller sets of packages. This helps prevent large backlogs and improves long-term performance.

Package Verification

There is no verification if packages are part of a Release Bundle or build. A package-level Cleanup policy may impact build or release bundle promotion.

Cleanup Limits

Cleanup policy can delete up to 100,000 packages in a single run.

Progress Notifications

Notifications on the progress of a cleanup policy run are unavailable.

Visibility of Run Results

Run results for global policies are visible only to Platform admins globally.

Search

A project admin can only perform searches within their project context and does not have access to the global scope.

Artifactory Configuration

The Artifactory Instance can only be a Platform or a Mothership, not an Edge

Concurrent Execution and Queuing of Cleanup Policies

  • Cleanup Policies can run concurrently up to a specified maximum. When this limit is reached, additional triggered policies are queued. Any further triggered policies will be skipped entirely if the queue reaches its maximum capacity.
  • In the current version of Artifactory, queued or skipped policy runs do not appear in the Runs view. You can find a log of skipped policies in the Artifactory Service log. For example, you might see a message like: "Policy: test_policy run: 1 has been rejected since 3 concurrent runs are already in progress."

The following limitations currently apply when you run a Release Bundle V2 policy:

Distributed Release Bundles

  • Cleanup policies will not delete distributed release bundles.

Source Artifacts

The source of release bundles, including associated builds and artifacts, will not be deleted.

Cleanup Known Issues

The following Known Issues were found in the Packages Cleanup Policy:

Editing Existing Cleanup Policy - Time-based Policy Conditions

When you edit a Cleanup Policy created before 7.111, you cannot modify settings for the following Time-based Policy Conditions:

  • Packages Older Than

  • Packages Not Downloaded Since

    Workaround: Create a new cleanup policy for the packages and configure it according to your needs.

Debian Package

When Debian packages are uploaded directly to the root directory, all packages may be cleaned during cleanup actions.

📘

Impact

Only the Version-based condition is affected by this issue. The Time-based condition remains unaffected.

Workaround: To avoid unintended cleanup, always upload Debian packages to a subdirectory rather than the root.

To learn more, refer to Artifactory 7.98 Known Issues.

SBT Package

When SBT packages are uploaded with the sbt-default repository layout, they are not resolved during cleanup actions.

Workaround: Choose Recommended Repository Layouts as described in the sbt Repository Layouts.

Cleanup Supported Packages

This topic outlines the supported packages with cleanup. It includes the policy conditions that apply to each package type.

Package TypeSupported Release VersionLead ArtifactAge (Packages Older Than)Usage (Packages Not Downloaded Since)Version (Number of Latest Versions to Keep)
Docker7.98.2manifest.json
Note: Supported from V 7.115.1
Maven7.98.2.pom
npm7.98.2.tgz
Gradle7.98.2.pom
Generic7.98.2-
RPM | YUM7.98.2.rpm
Conan7.98.2conanfile.py
NuGet7.98.2.nupkg
PyPI7.98.2tar.gz, tgz, gz, whl, egg, bz2
Helm7.98.2.tgz
Go7.98.2.mod
Debian7.98.2.deb, .ddeb
Gems7.96.3.gem
HuggingFaceML7.100.0.jfrog_huggingface_model_info.json, .jfrog_huggingface_dataset_info
CocoaPods7.99.1.tar.gz, .tgz
Terraform7.99.1.zip
Terraform BE7.103.0.json
Machine Learning7.104.2model-manifest.json
Ansible7.104.2tar.gz
Cargo (Rust)7.102.0.crate
OCI7.102.0manifest.json
Note: Supported from V 7.115.1
Helm OCI7.102.0manifest.json
Note: Supported from V 7.115.1
Conda7.105.2tar.bz2
SBT7.108.pom, .xml
Alpine7.111.0.tar.gz, .apk
Hex7.111.0*
Vagrant7.111.0*
Chef7.112*
Puppet7.112*
Swift7.114.1
Composer7.116
📘

Note

Several package types consist of multiple underlying files. The package-level cleanup policy determines if the entire package should be removed by checking the statistics or metadata of the lead artifact. For example, in a Maven package, the policy checks the statistics of the .pom file. If the file meets the criteria, the entire package is eligible for cleanup.

Docker Image Cleanup

Docker images can have multiple tags and use list.manifests to support different architectures. Each list.manifest points to several specific manifests for various systems.

Learn how the policy executes for the following conditions:

  • Time-based Condition: Time-based condition delete images and tags that have not been used within a certain period. This helps keep the connections between tags intact and ensures the stability of multi-architecture references. We recommend using the Packages Not Downloaded Since condition to prevent the deletion of images that are currently in use.

  • Version-based Condition: From Artifactory V 7.115.1, we support Version-based policy conditions for Docker. It allows you to keep a specified number of image versions in the Docker repository, which considers the structure of Docker images when deciding what to delete. If a Docker image is a list.manifest, it will either be deleted with all of its related sub-manifests or not deleted at all. This approach maintains the relationships between images. This provides greater control over image management and helps maintain tag relationships and multi-architecture references.

    On the other hand, time-based conditions treat each manifest and list.manifest separately, without considering their hierarchical structure. Each one is evaluated independently based on its status.

📘

Note

  • Tag Retention Logic: When this logic is enabled, previous tag revisions (tag retentions) will be removed only when the most recent revision of a tag is deleted.

  • Max Unique Tags Logic: When this logic is enabled, the Last N Versions policy will take precedence.

    Example: With Last N Versions set to 2 and Max Unique Tags set to 5, retains only 2 versions/tags of the same image after the policy is executed.

❗️

Avoid Policies with Conflicting Criteria

We recommend to avoid configuring two different policies with conflicting criteria (For example, Last N Versions and Not Downloaded Since) for the same Docker, OCI, or Helm OCI repository.

Getting Started with Cleanup

This topic outlines how to get started with Cleanup. It includes granting permission to a project admin, working with cleanup, and monitoring cleanup operations.

Cleanup_GS.png

Task

Description

Reference Links

1

Grant Permission to a Project Admin to Create and Edit Cleanup Policies

This topic outlines how to grant permission to a project admin. Platform admins can enforce and manage cleanup policies across multiple projects or all projects on the JFrog platform and thereby gain full control over organizational storage management (Global Policies). Platform admins can also delegate permissions to Project admins to manage policies on their project scope only (Project Policies), and Project admins have visibility on Global Policies affecting their projects.

Grant Permission to a Project Admin

2

Work with Cleanup

This section outlines working with cleanup. It includes creating and managing cleanup policies and managing cleanup runs

Work with Cleanup

Ideal_Cleanup_Workflow.png
  1. Create Cleanup Policy
  2. View All Cleanup Policies
  3. Perform Dry Run Cleanup Policy
  4. Download Last Run Report Cleanup Policy
  5. Enable/Disable Cleanup Policy
  6. Run Cleanup Policy Manually

Cleanup - User Activities and Authorizations

This topic outlines cleanup user activities and their authorizations.

Grant Permission to Project Admin

ActivityPlatform AdminProject AdminNon-admin User
Grant Permission to a Project Admin

Activity

Platform Admin

Project Admin

Non-admin User

Create Cleanup Policy

Note: Only from allocated projects

Activity

Platform Admin

Project Admin

Note: Applicable within the scope of your project context

Non-admin User

Edit Cleanup Policy

Enable/Disable Cleanup Policy

Perform Dry Run Cleanup Policy

Run Cleanup Policy Manually

Edit Cleanup Policy

Stop a Running Cleanup Policy

Delete Cleanup Policy

Download Last Run Report Cleanup Policy

Disable All Cleanup Policies

Note: This option is shown from the Global Context only.

Search Cleanup Policy

Stop All Cleanup Policy Runs

Note: This option is shown from the Global Context only.

Activity

Platform Admin

Project Admin

Note: Applicable within the scope of your project context

Non-admin User

View All Cleanup Runs

Stop All Cleanup Policy Runs

Download and Review Cleanup Run Report

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

Grant Permission to a Project Admin

This topic outlines how to grant permission to a project admin. Platform admins can enforce and manage cleanup policies across multiple projects or all projects on the JFrog platform and thereby gain full control over organizational storage management (Global Policies). Platform admins can also delegate permissions to Project admins to manage policies on their project scope only (Project Policies), and Project admins have visibility on Global Policies affecting their projects.

Global Policy: For maintaining consistent cleanup policies across multiple projects, ensuring compliance and standardization.

  • Scope: Applies to all packages across the entire Artifactory instance.
  • Configuration: Set by platform administrators and affects all projects at global level.

Project Policy: For addressing unique cleanup policies for a project that differ from the global standard, allowing flexibility to project administrators.

  • Scope: Applies to individual projects.
  • Configuration: Set by project/platform administrators for specific needs and requirements of a project.

To grant permissions to project admins, follow these steps:

  1. From the Administration module, click Projects.

    GrantProjectAdminAccess.gif

  2. In the Projects screen, select the project where you want to give permissions to the Project Admin.

    The project details appear in read-only mode.

  3. Click Edit Settings in the upper right of the project details screen.

  4. Go to the section Project Admins, and then click Manage Resources.

  5. Add the user to the project from the Users tab.

  6. Click Save.

Work with Cleanup

This section outlines working with cleanup. It includes creating and managing cleanup policies and managing cleanup runs

Cleanup_Workflow.png

Task

Description

For UI, see...

1

Create Cleanup Policy

This topic outlines how to create a cleanup policy. You create a cleanup policy to delete unintended packages, builds and release bundles V2 in Artifactory.

Create Cleanup Policy

2

Manage Cleanup - Policies

This section outlines the actions you can perform on the Cleanup Policies in Artifactory. It includes enable/disable, search, manual run, dry run, edit, stop, delete, view and delete policies.

Manage Cleanup - Policies

3

Manage Cleanup - Runs

This section outlines the actions you can perform on the Cleanup Runs in the Artifactory. It includes view, stop all runs and downloading run reports.

Manage Cleanup - Runs

Create Cleanup Policy

This topic outlines how to create a cleanup policy. You create a cleanup policy to delete unintended packages, builds and release bundles V2 in Artifactory.

TaskDescriptionFor UI, see...For API, see...For Terraform, see...
Create Cleanup Policy - PackagesThis topic outlines how to create a cleanup policy. You create a cleanup policy to delete unintended packages in Artifactory.Create Cleanup Policy - PackageCreate a Package Cleanup Policy APIartifactory_package_cleanup_policy (Resource)
Create Cleanup Policy - Release Bundles V2This topic outlines how to create a cleanup policy. You create a cleanup policy to delete unintended Release Bundle V2 in Artifactory.Create Cleanup Policy - Release Bundle V2Create a Release Bundle Cleanup Policy API
Create Cleanup Policy - BuildsThis topic outlines how to create a cleanup policy for builds. You create a cleanup policy to delete unintended builds in Artifactory.Create Cleanup Policy - BuildCreate Build Cleanup Policy API

Authorization

Activity

Platform Admin

Project Admin

Non-admin User

Create Cleanup Policy

Note: Only from allocated projects

Create Cleanup Policy – Package

This topic outlines how to create a cleanup policy. You create a cleanup policy to delete unintended packages in Artifactory.

To create a Package Cleanup Retention policy, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png
  1. In the Retention Policies page, from the Create Policy dropdown list, click Cleanup Policy.

  2. In the Create New Cleanup Policy page, select Package.

  3. Configure the following in the Create New Cleanup Policy page:

Field

Description

Policy Name

Enter a unique and meaningful name for the policy.

Description

Enter information regarding why this policy was created, and details that help users understand its configuration.

Policy Scope

Define what should be deleted

Include Projects / Include All Projects

📘

Note

This setting is applicable only at the global level for Platform Admins. It does not appear when creating a policy at the project level. When this setting is visible, it is mandatory.

Select the projects where you want the policy to apply, or choose Include All Projects to run the policy across all projects on the platform. You can also select Unassigned Repositories to apply the policy to repositories not linked to any projects.

Package Types

Select one or more of the package types you want to delete.

📘

Note

If a policy includes a repository with retention settings, packages designated for retention may be inadvertently deleted.

Include Repository Patterns

  • Enter one or more patterns or explicit repository names for the repository selection where you want the cleanup policy to apply. Alternatively, you can select Include All Repositories or specify explicit repository names. At least one pattern or explicit name is required, as only packages in repositories matching these will be deleted.

  • Auto-complete will suggest options based on the project and package type, and both local and federated repositories are supported.

📘

Note

It is not possible to specify a path within a repository.

📘

Note

Set Patterns: Use wildcards at the end to match any suffix, or at the start to match any prefix

For example, npm-local* includes all repositories starting with npm-local.

Regex is not supported.

Exclude Repository Patterns

Enter one or more patterns or explicit repository names to exclude from the cleanup policy. Auto-complete will suggest options based on the project and package type.

📘

Note

Set Patterns: Use wildcards at the end to match any suffix, or at the start to match any prefix.

For example, npm-local* excludes all repositories starting with npm-local.

Regex is not supported.

Include Package Name Pattern

Enter a pattern for a package name or an explicit package name for the cleanup policy, then click Add or select Include All Packages. Only one pattern or explicit name is allowed.

📘

Note

Set Patterns: Use wildcards at the end to match any suffix, or at the start to match any prefix.

For example, mypackage* includes all packages starting with mypackage.

Regex is not supported.

Exclude Package Name

Enter explicit package names to exclude from the policy and click Add. Only explicit names are accepted and not patterns.

Include Package Version Pattern

Enter a pattern for a package version or an explicit package version for the cleanup policy.

📘

Note

Set Patterns: Use wildcards at the end to match any suffix, or at the start to match any prefix.

For example, 1.0.* includes all packages starting with 1.0.

Regex is not supported. Only 1 pattern or explicit version can be entered.

Available from V 7.127 (Cloud) and V 7.125.7 (Self-managed)

Exclude Package Version Patterns

Enter explicit package version to exclude from the policy. Only explicit versions are accepted and not patterns.

Available from V 7.127 (Cloud) and V 7.125.7 (Self-managed)

Policy Conditions

Define under what conditions the policy finds packages

Time-based/Version-based/Property-based

Do one of the following to define under what conditions the policy finds packages:

📘

Note

A policy must include one of the two conditions below:

  • Time-Based: Can be used together

    • Packages Older Than

    • Packages Not Downloaded Since

      CALLSTART::Note::

      Note

      We recommend using the Packages Not Downloaded Since condition to prevent the cleanup of packages that are currently in use.

  • Version Based

    • Number of Latest Versions to Keep.

CALLEND::

  • Time-based: This condition can be used as follows:

    • Packages Older Than: Enable checkbox, and apply the number of days/weeks/months/years for the older packages.
📘

Note

From Version 7.111 onwards, days/weeks time unit is available.

A day in this context is a 24-hour period from the moment the policy is executed. Other units are considered as follows:

  • 1 week = 7 days
  • 1 month = 30 days
  • 1 year = 365 days

The system will convert them to appropriate time unit if the matching value is entered. For example, if you enter 7 days, the system changes it to 1 Week.

  • Deletes packages based on their creation date.

  • Also deletes packages that have never been downloaded.

  • Default: Deletes packages not downloaded for more than 2 years.

  • Packages Not Downloaded Since: Enable checkbox, and apply the number of days/weeks/months/years for the not downloaded packages.

📘

Note

From Version 7.111 onwards, days/weeks time unit is available.

A day in this context is a 24-hour period from the moment the policy is executed. Other units are considered as follows:

  • 1 week = 7 days
  • 1 month = 30 days
  • 1 year = 365 days

The system will convert them to appropriate time unit if the matching value is entered. For example, if you enter 7 days, the system changes it to 1 Week.

  • Deletes packages based on their last download date.

  • If a package was never downloaded, it deletes based on the creation date if it is older than the specified Not Downloaded Since period.

    For example:

    • Not Downloaded Since: 2 months, artifacts with 0 downloads

    • Package creation date:

      • 1 month ago: Not deleted
      • 2 months ago or older: Deleted
  • Default: Deletes packages not downloaded for more than 2 years.

  • Combined Conditions (Packages Older Than and Packages Not Downloaded Since): When used both conditions together:

    • Deletes packages based on both creation date and last download date.
  • Version-based - Number of Latest Versions To Keep

    Select the number of the latest versions to keep. The cleanup policy will delete all versions that exceed this number, with the latest version always excluded from deleting.

📘

Note

  • This setting appears only if Version-based is selected.
  • Versions are determined by creation date.
  • Not all package types support this condition. For information on which package types support this condition, refer to Cleanup Supported Packages.
  • Property-based

    Enter the property name and value applied to the lead artifact of a package. Packages with this property will be deleted. For information, refer to Cleanup Supported Packages.

Exclude based on property

Enable the checkbox and enter the property name and value applied to the lead artifact of a package. Packages with this property will be excluded from deletion. For information, refer to Cleanup Supported Packages

Settings

Cron Expression

A cron expression is a string comprised of five or six fields separated by spaces. Each field represents a different unit of time, which collectively define the schedule for policy execution. The standard format is as follows:

* * * * * *     (Seconds - Optional)
| | | | | |
| | | | | +---- Day of the week (0 - 6) (Sunday=0)
| | | | +------ Month (1 - 12)
| | | +-------- Day of the month (1 - 31)
| | +---------- Hour (0 - 23)
| +------------ Minute (0 - 59)
+-------------- Second (0 - 59) (Optional)
📘

Note

This cron expression must follow the Quartz scheduler format as used in the CronTrigger class. It differs from the standard Unix cron format. For example, Quartz supports a sixth optional field for seconds and uses ? for non-specific values. Refer to the Quartz documentation for more details: Quartz Cron Expression Format

Example Cron Expression

To illustrate how to construct a cron expression, consider the example below:

Expression: 0 0 2 * * ?

  • 0 - At second 0
  • 0 - At minute 0
  • 2 - At hour 2 (2:00 AM)
      • Every day of the month
      • Every month
  • ? - No specific value for the day of the week

This expression schedules the policy to run every day at 2:00 AM.

Guidelines for Scheduling

  • Run Interval: The minimum interval between policy executions is 6 hours. If you attempt to set a cron expression that results in a runtime shorter than this duration, you will encounter an error when saving the configuration.
  • Off-Hours Scheduling: It is recommended to tune your cron expression so that policies run during off-hours. This helps to reduce the impact on system performance during peak usage times.

Leaving the Cron Expression Empty: If you leave the cron expression empty, you can only Run Smart Archiving Policy Manually manually. This means that there will be no automatic scheduling and the policy will not run unless you initiate it.

Max Run Duration

This setting limits the maximum duration the policy can run when enabled. The maximum allowed duration is 5 hours.

📘

Note

The policy stops before the completion of the run if it exceeds the applied run duration. In one run, within this duration, it deletes all or part of your packages depending on the size and number of items. If there are any pending packages to be deleted, they are deleted incrementally in the next scheduled run and the subsequent runs.

Skip Trash Can

When enabled, this setting will cause packages to be permanently deleted from Artifactory instance without an option to restore them immediately after the cleanup policy is executed, bypassing the Trash Can repository.

📘

Note

If you want deleted items to be transferred to the trash can, you must enable the global Trash Can setting. To learn more, refer to Trash Can Settings.

  1. Click Save to save the policy.

    The newly created cleanup policy appears in the Policies list and executes on the scheduled date and time.

Create Cleanup Policy – Release Bundle V2

This topic outlines how to create a cleanup policy. You create a cleanup policy to delete unintended Release Bundle V2 in Artifactory.

To create a Release Bundle V2 Cleanup Retention policy, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png
  1. In the Retention Policies page, from the Create Policy dropdown list, click Cleanup Policy.

  2. In the Create New Cleanup Policy page, select Release Bundle V2.

  3. Configure the following in the Create New Cleanup Policy page:

Field

Description

Policy Name

Enter a unique and meaningful name for the policy.

Description

Enter information regarding why this policy was created, and details that help users understand its configuration.

Policy Scope

Define which Release Bundle versions should be deleted

Include Projects / Include All Projects

📘

Note

This setting is applicable only at the global level for Platform Admins. It does not appear when creating a policy at the project level. When this setting is visible, it is mandatory.

Select the projects where you want the policy to apply, or choose Include All Projects to run the policy across all projects on the platform. You can also select Unassigned Repositories to apply the policy to repositories not linked to any projects.

Include Release Bundles

Select one or more of the Release Bundles you want to delete.

Policy Conditions

Define under what conditions the cleanup policy removes Release Bundles versions

Release Bundle Versions Older Than

Apply the number of days/weeks/months/years for the older Release Bundles.

📘

Note

From Version 7.119.0 onwards, days/weeks time unit is available.

A day in this context is a 24-hour period from the moment the policy is executed. Other units are considered as follows:

  • 1 week = 7 days
  • 1 month = 30 days
  • 1 year = 365 days

The system will convert them to appropriate time unit if the matching value is entered. For example, if you enter 7 days, the system changes it to 1 Week.

Not Promoted To Environments

Select one or more of the environments the release bundles are not promoted to.

📘

Note

Select Exclude Release Bundles that have been promoted to any environment to exclude them from deletion.

Additional Settings

Cron Expression

A cron expression is a string comprised of five or six fields separated by spaces. Each field represents a different unit of time, which collectively define the schedule for policy execution. The standard format is as follows:

* * * * * *     (Seconds - Optional)
| | | | | |
| | | | | +---- Day of the week (0 - 6) (Sunday=0)
| | | | +------ Month (1 - 12)
| | | +-------- Day of the month (1 - 31)
| | +---------- Hour (0 - 23)
| +------------ Minute (0 - 59)
+-------------- Second (0 - 59) (Optional)
📘

Note

This cron expression must follow the Quartz scheduler format as used in the CronTrigger class. It differs from the standard Unix cron format. For example, Quartz supports a sixth optional field for seconds and uses ? for non-specific values. Refer to the Quartz documentation for more details: Quartz Cron Expression Format

Example Cron Expression

To illustrate how to construct a cron expression, consider the example below:

Expression: 0 0 2 * * ?

  • 0 - At second 0
  • 0 - At minute 0
  • 2 - At hour 2 (2:00 AM)
      • Every day of the month
      • Every month
  • ? - No specific value for the day of the week

This expression schedules the policy to run every day at 2:00 AM.

Guidelines for Scheduling

  • Run Interval: The minimum interval between policy executions is 6 hours. If you attempt to set a cron expression that results in a runtime shorter than this duration, you will encounter an error when saving the configuration.
  • Off-Hours Scheduling: It is recommended to tune your cron expression so that policies run during off-hours. This helps to reduce the impact on system performance during peak usage times.

Leaving the Cron Expression Empty: If you leave the cron expression empty, you can only Run Smart Archiving Policy Manually manually. This means that there will be no automatic scheduling and the policy will not run unless you initiate it.

Max Run Duration

This setting limits the maximum duration the policy can run when enabled. The maximum allowed duration is 5 hours.

📘

Note

The policy stops before the completion of the run if it exceeds the applied run duration. In one run, within this duration, it deletes all or part of your release bundles V2 depending on the size and number of items. If there are any pending release bundles v2 to be deleted, they are deleted incrementally in the next scheduled run and the subsequent runs.

  1. Click Save to save the policy.

    The newly created cleanup policy appears in the Policies list and executes on the scheduled date and time.

Create Cleanup Policy – Build

This topic outlines how to create a cleanup policy for builds. You create a cleanup policy to delete unintended builds in Artifactory.

Removing a build deletes build entity, build-info and build artifacts. To exclude build artifacts from deletion, uncheck Delete Build Artifacts checkbox under Settings (It is checked by default).

To create a Build Cleanup Retention policy, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, from the Create Policy dropdown list, click Cleanup Policy.

  2. In the Create New Cleanup Policy page, select Build.

  3. Configure the following in the Create New Cleanup Policy page:

Field

Description

Policy Name

Enter a unique and meaningful name for the policy.

Description

Enter information regarding why this policy was created, and details that help users understand its configuration.

Policy Scope

Define what should be deleted

Include Projects / Include All Projects

📘

Note

This setting is applicable only at the global level for Platform Admins. It does not appear when creating a policy at the project level. When this setting is visible, it is mandatory.

Select the projects where you want the policy to apply, or choose Include All Projects to run the policy across all projects on the platform. You can also select Unassigned Repositories to apply the policy to repositories not linked to any projects.

Include Build Patterns/Include All Builds

From the dropdown, select the build or choose Include All Builds to run the policy across all builds.

📘

Note

Specify builds to include by explicit name. (or) Use wildcards at the end to match any suffix. For example, buildxyz* includes all builds starting with buildxyz.

Using * as a wildcard at the start of the pattern isn't allowed. For example, *buildxyz is invalid.

Policy Conditions

Define under what conditions the policy finds builds

Builds older than

Specify the number of days/weeks/months/years for the older builds.

  • Deletes builds based on their creation date.
📘

Note

A day in this context is a 24-hour period from the moment the policy is executed. Other units are considered as follows:

  • 1 week = 7 days
  • 1 month = 30 days
  • 1 year = 365 days

The system will convert them to appropriate time unit if the matching value is entered. For example, if you enter 7 days, the system changes it to 1 Week.

Settings

Delete Build Artifacts

Deletes the artifacts associated with the build.

📘

Note

This setting is enabled by default. Disable the checkbox to exclude build artifacts from deletion.

When determining which artifacts will be deleted with your build, the following rules apply:

  • Artifact Resolution from Build-Info: If the full repository path of the build artifacts exists in the build-info, the artifacts will be resolved from their original location where the build was published via the CLI.
📘

Note

This behavior is available from version 7.106.1.

  • Older Builds: If the build artifacts do not have an available full repository path, they will be resolved using their SHA and associated properties: build.name, build.number, and build.timestamp.
📘

Note

  • If the artifacts were promoted or copied to another target, they will also be deleted from those locations.

  • For certain build integration tools (for example, Jenkins) that may create inconsistent build.timestamp (compared to the build-info's started field), the deletion process will check if the same build name and build number exist in another project.

    • If found, the artifacts will not be deleted.
    • If not found, the artifacts will be deleted based on their SHA and properties (build.name, build.number).

    Always use a recent version of JFrog CLI as your build client for optimal results. For more information and to download the latest version, refer to CLI Documentation and Build Integration.

Cron Expression

A cron expression is a string comprised of five or six fields separated by spaces. Each field represents a different unit of time, which collectively define the schedule for policy execution. The standard format is as follows:

* * * * * *     (Seconds - Optional)
| | | | | |
| | | | | +---- Day of the week (0 - 6) (Sunday=0)
| | | | +------ Month (1 - 12)
| | | +-------- Day of the month (1 - 31)
| | +---------- Hour (0 - 23)
| +------------ Minute (0 - 59)
+-------------- Second (0 - 59) (Optional)
📘

Note

This cron expression must follow the Quartz scheduler format as used in the CronTrigger class. It differs from the standard Unix cron format. For example, Quartz supports a sixth optional field for seconds and uses ? for non-specific values. Refer to the Quartz documentation for more details: Quartz Cron Expression Format

Example Cron Expression

To illustrate how to construct a cron expression, consider the example below:

Expression: 0 0 2 * * ?

  • 0 - At second 0
  • 0 - At minute 0
  • 2 - At hour 2 (2:00 AM)
      • Every day of the month
      • Every month
  • ? - No specific value for the day of the week

This expression schedules the policy to run every day at 2:00 AM.

Guidelines for Scheduling

  • Run Interval: The minimum interval between policy executions is 6 hours. If you attempt to set a cron expression that results in a runtime shorter than this duration, you will encounter an error when saving the configuration.
  • Off-Hours Scheduling: It is recommended to tune your cron expression so that policies run during off-hours. This helps to reduce the impact on system performance during peak usage times.

Leaving the Cron Expression Empty: If you leave the cron expression empty, you can only Run Smart Archiving Policy Manually manually. This means that there will be no automatic scheduling and the policy will not run unless you initiate it.

Max Run Duration

This setting limits the maximum duration the policy can run when enabled. The maximum allowed duration is 5 hours.

📘

Note

The policy stops before the completion of the run if it exceeds the applied run duration. In one run, within this duration, it deletes all or part of your builds depending on the size and number of items. If there are any pending builds to be deleted, they are deleted incrementally in the next scheduled run and the subsequent runs.

Skip Trash Can

When enabled, this setting will cause builds to be permanently deleted from Artifactory instance without an option to restore them immediately after the cleanup policy is executed, bypassing the Trash Can repository.

📘

Note

If you want deleted items to be transferred to the trash can, you must enable the global Trash Can setting. To learn more, refer to Trash Can Settings.

  1. Click Save to save the policy.

    The newly created cleanup policy appears in the Policies list and executes on the scheduled date and time.

What Happens after the Cleanup Policy is Created?

This topic outlines what happens after a cleanup policy is created.

After the Cleanup policy has been defined and created:

  • Enabled cleanup policies execute on the scheduled date and time.

    The cleanup policy can also be manually executed. To learn more, refer to Run Cleanup Policy Manually.

📘

Note

We recommend not to run more than 10 policies at the same time.

The Cleanup policy does not execute when an ongoing mandatory task is in progress (for example, Garbage Collection). If you want to manually Run Cleanup Policy Manually or Perform Dry Run Cleanup Policy, try at a later time.

  • The system deleted the items, along with the associated metadata.
  • As the cleanup process progresses, View All Cleanup Runs.

Manage Cleanup - Policies

This section outlines the actions you can perform on the Cleanup Policies in Artifactory. It includes enable/disable, search, manual run, dry run, edit, stop, delete, view and delete policies.

The following table lists all the possible actions on the policies and their equivalent links to REST API.

Task

Description

For UI, see...

For API, see...

View All Policies

This section outlines how to view all cleanup policies. It guides you in reviewing key details such as the policy status, associated projects with the policy, timestamps for the last and next scheduled runs, last run status, actions performed on each policy, and options for customizing table columns.

View All Cleanup Policies

Perform a Dry Run

This section outlines how to perform a dry run for a cleanup policy. A dry run lets you preview which items will be deleted based on your defined policy criteria, without performing the actual deleting. This helps you understand the potential outcome before executing the policy. After the dry run, a CSV report is generated, listing all items that would be deleted along with relevant details. Review this list to decide whether to proceed with the policy or adjust the settings.

Perform Dry Run Cleanup Policy

Download the Last Run Report

This section outlines how to download the last run report. The report is in CSV format and lists all deleted items with relevant information. You can review the list to learn about the deleted items.

Download Last Run Report Cleanup Policy

Enable/Disable Policy

This topic outlines how to enable/disable a cleanup policy. By default, newly created cleanup policies are disabled. You must activate a policy before it can execute automatically according to the schedule or be triggered manually.

Enable/Disable Cleanup Policy

Run Now

This topic outlines how to run a cleanup policy manually. In addition to the periodic automated execution of the cleanup policy that occurs if you enable the policy and set its Cron Expression, you can also manually run the cleanup policy at any time.

Run Cleanup Policy Manually

Search Policies

This topic outlines how to search for cleanup policies to locate the desired policy easily.

Search Cleanup Policy

Disable All Policies

This topic outlines how to disable all cleanup policies. As a Platform Admin, you can disable all policies globally, making them inactive. Once this is done, you can activate policies individually as needed.

Disable All Cleanup Policies

Disable All Cleanup Policies API

Edit Policy

This topic outlines how to edit a Cleanup policy. After the cleanup policy has been created, you can change the settings or cleanup criteria.

Edit Cleanup Policy

Stop Policy

This topic outlines how to stop a running cleanup policy. For some reason, you may want to stop a running cleanup policy that is currently running before it finishes completion.

Stop a Running Cleanup Policy

Stop a Running Cleanup Policy API

Delete Policy

This topic outlines how to delete a Cleanup policy. If you decide that a cleanup policy is no longer needed, you can delete it.

Delete Cleanup Policy

Stop All Runs

This topic outlines how to stop all cleanup policy runs. You can perform this action from the policies tab and runs tab. As a Platform Admin, you can stop all currently running policies. Once a policy run is stopped, it cannot resume from its last point. You must restart the policy from the beginning to rerun it.

Stop All Cleanup Policy Runs

Stop All Running Cleanup Policies API

Authorization

Activity

Platform Admin

Project Admin

Note: Applicable within the scope of your project context

Non-admin User

Edit Cleanup Policy

Enable/Disable Cleanup Policy

Perform Dry Run Cleanup Policy

Run Cleanup Policy Manually

Edit Cleanup Policy

Stop a Running Cleanup Policy

Delete Cleanup Policy

Download Last Run Report Cleanup Policy

Disable All Cleanup Policies

Note: This option is shown from the Global Context only.

Search Cleanup Policy

Stop All Cleanup Policy Runs

Note: This option is shown from the Global Context only.

View All Cleanup Policies

This section outlines how to view all cleanup policies. It guides you in reviewing key details such as the policy status, associated projects with the policy, timestamps for the last and next scheduled runs, last run status, actions performed on each policy, and options for customizing table columns.

To view all the Cleanup policies, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. Under the Policies tab, you can view all the policies.

Cleanup Policy Table Fields

The following table describes the columns of the cleanup policy table fields.

Field

Description

Policy Name

Indicates the name of the policy

Object Type

Indicated the type of object. It can be Packages or Release Bundles.

Global

Indicates whether it is a global policy.

Global Policy may affect multiple projects. It can be managed by a Platform Admin on the Global Scope only.

Project

Indicates the name of the project

Note: Unassigned Repos: Only repositories not assigned to a project will be affected.

Last Run Status

Indicates the status of each policy execution, which can be one of the following:

  • Completed (dry run): The policy has been executed successfully, with no errors

  • Completed: The policy has been executed successfully, with no errors

  • Completed with Errors: The policy execution has been completed, but there were some errors. Please refer to the logs for details

  • Completed with Errors (dry run): The policy has been executed with errors

  • In Progress: The policy execution is in progress and there are no errors

  • In Progress with Errors: The policy execution is in progress and there are errors

  • Stopping: The user has manually stopped the policy execution, and it is currently being stopped

  • Stopped: The user manually stopped the policy execution

  • Failed: The policy execution has failed

Last Run

Indicates when the last run was executed

Next Run

Indicates the next scheduled run

Enabled

Indicates whether the policy is enabled or disabled:

  • Enabled: Indicates the policy has been enabled. You can run the policy manually or it runs as per the defined schedule

  • Disabled: Indicates the policy has been disabled. You can perform dry run but not manual or scheduled runs.

More Actions

From the more icon you can perform various actions on the policies. The actions are as follows:

Icon

Action

Description

Run Now

Manually run the enabled policy

Perform a Dry Run

Review which packages will be deleted on the actual run

Edit

Edit the policy to make necessary changes

Stop

Stop a running policy

Download Last Report

On completing the run, download the last run report based on the Last Run Status to review:

  • For Actual Run

    What packages were deleted for the actual run

  • For Dry Run

    What packages will be deleted on the actual run

Delete

Delete the policy from the system.

Customize Table Columns

Arrange the table columns according to how you want to view them.

Follow these steps to display and arrange the columns:

  1. From the Table header, click the Customize Columns at the end.

  2. Select which columns to display in the Customize Columns pop-up and drag and drop to reorder them.

  3. Click Apply.

Refresh Policies

To refresh policies, click Refresh icon from the top right above the table header.

Search Cleanup Policy

This topic outlines how to search for cleanup policies to locate the desired policy easily.

To search the Cleanup policy, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. Click the Policies tab, enter the policy name in the Search field, and then press enter on the keyboard.

Perform Dry Run Cleanup Policy

This section outlines how to perform a dry run for a cleanup policy. A dry run lets you preview which items will be deleted based on your defined policy criteria, without performing the actual deleting. This helps you understand the potential outcome before executing the policy. After the dry run, a CSV report is generated, listing all items that would be deleted along with relevant details. Review this list to decide whether to proceed with the policy or adjust the settings.

📘

Note

  • We recommend performing a dry run and reviewing the results before activating a policy to prevent unintended deletion.
  • Dry run results reflect the specific point in time when the dry run is performed. The results of an actual policy execution may differ, as it occurs at a later scheduled time.

To perform a dry run for the Cleanup policy, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. From the Policies tab, under Policies, locate the policy you want to run, click the ••• icon and then click Dry Run.

  3. After the dry run is completed:

    1. Download the report from Download Last Run Report Cleanup Policy or Download and Review Cleanup Run Report.
    2. Review its status report, as explained in Cleanup Run Report Overview.

Enable/Disable Cleanup Policy

This topic outlines how to enable/disable a cleanup policy. By default, newly created cleanup policies are disabled. You must activate a policy before it can execute automatically according to the schedule or be triggered manually.

📘

Note

We recommend that you first perform a dry run and review its results before you enable a policy. This helps prevent unintended deletion. For more information on performing a dry run, refer to Perform Dry Run Cleanup Policy.

The following actions can be performed on a disabled policy:

To Enable or Disable the Cleanup policy, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. From the Policies tab, under Policies, locate the policy you want to enable/disable, and then toggle the slider under the Active column.

    Once enabled, the policy will run automatically based on the schedule you set during creation. You can also run it manually, as detailed in the Run Cleanup Policy Manually.

Disable All Cleanup Policies

This topic outlines how to disable all cleanup policies. As a Platform Admin, you can disable all policies globally, making them inactive. Once this is done, you can activate policies individually as needed.

📘

Note

The option to disable all policies is not available to Project Admins.

To disable all the Cleanup policies, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context
📘

Note

Applies to Platform Admin only.

  1. From the Projects dropdown list, click All Projects.
📘

Note

The Disable All Policies option can be viewed in the global context only.

  1. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

    The Retention Policies page appears.

  2. In the Retention Policies page, click Cleanup.

  3. From the Policies tab, click Global Stop/Disable dropdown list, and then click Disable All Policies.

    The Disable All Policies dialog appears.

  4. In the Disable All Policies dialog, click Disable All Policies to confirm.

  5. Check the Active column in the policies list to verify that all policies are now disabled.

Run Cleanup Policy Manually

This topic outlines how to run a cleanup policy manually. In addition to the periodic automated execution of the cleanup policy that occurs if you enable the policy and set its Cron Expression, you can also manually run the cleanup policy at any time.

📘

Note

To manually run a cleanup policy, the policy must first be activated. To learn more, refer to Enable/Disable Cleanup Policy.

To run the Cleanup policy manually, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. From the Policies tab, under Policies, locate the policy you want to run, click ••• icon and then click Run.

  3. After the run is completed:

    1. Download the completed report from Download Last Run Report Cleanup Policy or Download and Review Cleanup Run Report.
    2. Review downloaded report. To learn more, refer to Cleanup Run Report Overview.

Download Last Run Report Cleanup Policy

This section outlines how to download the last run report. The report is in CSV format and lists all deleted items with relevant information. You can review the list to learn about the deleted items.

To download the report, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. From the Policies tab, under Policies, locate the policy for which you want to download the report, click ••• icon, and then click Download Last Report.

    A zip file is downloaded including one .csv file.

  3. Review the downloaded report. To learn more, refer to Cleanup Run Report Overview.

Stop a Running Cleanup Policy

This topic outlines how to stop a running cleanup policy. For some reason, you may want to stop a running cleanup policy that is currently running before it finishes completion.

📘

Note

Once a policy has been stopped, it cannot resume from the point where it stopped. The only way to run the policy again is to restart it from the beginning.

To stop the running Cleanup policy, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. From the Policies tab, under Policies, locate the policy you want to stop, click ••• icon and then click Stop.

  3. In the Status column of Runs tab, the status changes to Stopped for that run.

Stop All Cleanup Policy Runs

This topic outlines how to stop all cleanup policy runs. You can perform this action from the policies tab and runs tab. As a Platform Admin, you can stop all currently running policies. Once a policy run is stopped, it cannot resume from its last point. You must restart the policy from the beginning to rerun it.

📘

Note

The option to stop all running policies is not available to Project Admins.

To stop all the Cleanup policy runs, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context
📘

Note

Applies to Platform Admin only.

  1. From the Projects dropdown list, click All Projects.
📘

Note

The Stop All Runs option can be viewed in the global context only.

  1. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

    The Retention Policies page appears.

  2. In the Retention Policies page, click Cleanup.

  3. From the Policies tab, click Global Stop/Disable, and then click Stop All Runs.

    Stop All Runs dialog appears.

  4. In the Stop All Runs dialog, click Stop All Runs to confirm.

    To verify that all runs have stopped, under the Policies tab, check the Last Run Status column to ensure that all runs have stopped.

Edit Cleanup Policy

This topic outlines how to edit a Cleanup policy. After the cleanup policy has been created, you can change the settings or cleanup criteria.

📘

Note

You cannot update a running policy. If you want to update a policy that is running, you need to either wait for the run to complete or Stop a Running Cleanup Policy.

To edit the Cleanup policy, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. From the Policies tab, under Policies, locate the policy you want to edit, click ••• icon and then click Edit.

    Edit <Policy Name> Cleanup Policy page appears.

  3. In the <Policy Name> Cleanup Policy page, update the settings as needed, and then click Save.

Delete Cleanup Policy

This topic outlines how to delete a Cleanup policy. If you decide that a cleanup policy is no longer needed, you can delete it.

📘

Note

You cannot delete a running policy. If you want to delete a running policy, you need to either wait for the run to complete or Stop a Running Cleanup Policy.

To delete the Cleanup policy, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. From the Policies tab, under Policies, locate the policy you want to delete, click ••• icon and then click Delete.

    Delete Policy dialog appears.

  3. In the Delete Policy dialog, click Delete to confirm.

    The policy is deleted and removed from the Policies list.

Manage Cleanup - Runs

This section outlines the actions you can perform on the Cleanup Runs in the Artifactory. It includes view, stop all runs and downloading run reports.

Task

Description

For UI, see...

For API, see...

View All Cleanup Runs

This section outlines how to view the status of both past and ongoing cleanup runs. It provides guidance on how to review specific details, including the items that have been deleted, the associated timestamps, the status of each cleanup operation, customizing table columns, and applying filters to view the desired information.

View All Cleanup Runs

NA

Stop All Cleanup Policy Runs

This topic outlines how to stop all cleanup policy runs. You can stop all currently running policies. Once a policy run is stopped, it cannot resume from its last point. You must restart the policy from the beginning to rerun it.

Stop All Cleanup Policy Runs

Stop All Running Cleanup Policies API

Download and Review Cleanup Run Report

This section outlines how to download a cleanup run report. The report is in CSV format and lists all deleted items with relevant information. You can review the list to learn about the deleted items.

Download and Review Cleanup Run Report

Cleanup Run Report Overview

Authorization

Activity

Platform Admin

Project Admin

Note: Applicable within the scope of your project context

Non-admin User

View All Cleanup Runs

Stop All Cleanup Policy Runs

Download and Review Cleanup Run Report

View All Cleanup Runs

This section outlines how to view the status of both past and ongoing cleanup runs. It provides guidance on how to review specific details, including the items that have been deleted, the associated timestamps, the status of each cleanup operation, customizing table columns, and applying filters to view the desired information.

To view the Cleanup policy runs, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. From the Runs tab, under Runs, locate the Run Id you want to learn about it.

    In this list, you can review a comprehensive history of executed cleanup policies, including the start time, number and physical size of deleted items, and run status. The list is sorted chronologically, with the most recent run at the top. For more information on run statuses, see the table below.

  3. To view a report on a specific policy run, locate the run, and then click Report icon.

    A zip file will be downloaded containing one or more .csv files. If the report is for a dry run, it will show the items that would be deleted in a real run. If it’s for an actual cleanup run, it will detail what was deleted.

📘

Note

  • Reports are created and stored in a dedicated repository called jfrog-policy-reports-local. We recommend not deleting this repository to maintain a history of policy executions and their results. Deleting it will result in the loss of this history.
  • If no items are deleted (for a real run) or deleted (for a dry run), a report will not be generated.
  • The number of previous runs included in the history is defined by the artifactory.policy.cleanup.nodes_cleaned.expiration.days system property. To learn more, refer to Cleanup Policies System Properties.

Cleanup Runs Table Fields

The following table describes the columns of the cleanup runs table fields.

Field

Description

Run ID

Indicates the number of the run id

Global

Indicates the policy is applicable at the global level

Note

Global Policy may affect multiple projects. It can be managed by a Platform Admin on the Global Scope only.

Project

Indicates the name of the project

Object Type

Indicated the type of object. It can be Packages or Release Bundles.

Policy Name

Indicates the name of the policy

Start Time

Indicates the date and time when the cleanup operation started running

Cleaned Items (Physical Size)

The number of total deleted items, and the total items (The deleted size)

Status

Indicates the status of each policy execution, which can be one of the following:

  • Completed (dry run): The policy has been executed successfully, with no errors

  • Completed: The policy has been executed successfully, with no errors

  • Completed with Errors: The policy execution has been completed, but there were some errors. Please refer to the logs for details

  • Completed with Errors (dry run): The policy has been executed with errors

  • In Progress: The policy execution is in progress and there are no errors

  • In Progress with Errors: The policy execution is in progress and there are errors

  • Stopping: The user has manually stopped the policy execution, and it is currently being stopped

  • Stopped: The user manually stopped the policy execution

  • Failed: The policy execution has failed

Report

Indicates the report download state as follows:

  • Enabled: Indicates the report is available for download

  • Selected: Indicates the download icon is clicked

  • Disabled: Indicates the report is not available

Customize Table Columns

Arrange the table columns according to how you want to view them.

Follow these steps to display and arrange the columns:

  1. From the Table header, click Customize Columns icon at the end.

  2. Select which columns to display in the Customize Columns pop-up and drag and drop to reorder them.

  3. Click Apply.

Apply Filters to Sort Run Results

You can apply the filter to the run results to easily access your desired view.

To apply filters, follow these steps:

  1. Click the Filter icon from the top right above the table header.

  2. Apply the following fields as you want to sort:

NameDescription
Policy NameEnter the name of the policy and choose the policy from the list
ProjectEnter the name of the project and choose the project from the list
Start TimeSelect from the dropdown list or customize as per the timelines using the calendar
StatusSelect the run status from the available list. To learn about statuses, refer to Cleanup Runs Table Fields and Status field.
OtherSelect the available options as applicable
  1. To remove applied filters, click Clear all.

Refresh Cleanup Runs

If you don't see the latest created runs in the list, you can refresh the runs to view them.

To refresh runs, click Refresh icon from the top right above the table header.

Stop All Cleanup Policy Runs

This topic outlines how to stop all cleanup policy runs. You can perform this action from the policies tab and runs tab. As a Platform Admin, you can stop all currently running policies. Once a policy run is stopped, it cannot resume from its last point. You must restart the policy from the beginning to rerun it.

📘

Note

The option to stop all running policies is not available to Project Admins.

To stop all the Cleanup policy runs, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context
📘

Note

Applies to Platform Admin only.

  1. From the Projects dropdown list, click All Projects.
📘

Note

The Stop All Runs option can be viewed in the global context only.

  1. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

    The Retention Policies page appears.

  2. In the Retention Policies page, click Cleanup.

  3. From the Policies tab, click Global Stop/Disable, and then click Stop All Runs.

    The Stop All Runs dialog appears.

  4. In the Stop All Runs dialog, click Stop All Runs to confirm.

    To verify that all runs have stopped, under the Policies tab, check the Last Run Status column to ensure that all runs have stopped.

Download and Review Cleanup Run Report

This section outlines how to download a cleanup run report. The report is in CSV format and lists all deleted items with relevant information. You can review the list to learn about the deleted items.

📘

Note

The report is generated for both actual run and dry run.

To download the report, follow these steps:

As per the User persona, you can work with the contexts as described below:

  • Global Context

    📘

    Note

    Applies to Platform Admin only.

    1. From the Projects drop-down list, click All Projects.

    2. From the Administrator module, click Artifactory Settings, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyPlatformAdmin.png
  • Project Context

    📘

    Note

    Applies to both Platform Admin and Project Admin.

    1. From the Projects drop-down list, choose the desired project.

    2. From the Administrator module, click Artifactory, and then click Retention Policies.

      The Retention Policies page appears.

      HC_CreatePolicyProjectAdmin.png

  1. In the Retention Policies page, click Cleanup.

  2. From the Runs tab, under Runs, locate the run for which you want to download the report, and then click Download icon.

    A zip file is downloaded including one .csv file.

    Possible Download icon statuses are as follows:

IconStateDescription
EnabledIndicates the report is available for download
HoverOn hovering the mouse pointer,
SelectedIndicates the download icon is clicked.
DisabledIndicates the report is not available.
  1. Reveiw the downloaded report. To learn more, refer to Cleanup Run Report Overview
Cleanup Run Report Overview

The downloaded CSV report provides a detailed summary of the cleanup process, including information on the policy used, the status of the run, and the items processed.

  • Following are the package cleanup report fields:

Field

Description

Run General Details

The general details of the cleanup run

cleanup run for <policy-name> <status>

The policy name and current status of the cleanup run.

isDryRun

Indicates whether the run was a dry run or an actual run.

  • True: Dry run (no changes made)
  • False: Actual run (changes applied)

Run Start Time

The timestamp when the cleanup process started

Duration

The total time taken for the cleanup process

Run Summary

The summary of the cleanup run

cleanup packages count

The total number of packages successfully deleted

Total packages count

The total number of packages processed during the cleanup

Packages virtual size

The virtual size of all deleted packages

Packages physical size

The actual physical size of all deleted packages

Policy Configuration For This Run

Indicates the configuration details of the policy

Policy Key

The name of the cleanup policy used for this run

Description

A description of the cleanup policy

Cron Expression

The cron expression used to schedule the cleanup runs

Max Run Duration

The maximum duration allowed for the policy to run

Skip Trash Can

Indicates if the trash can was skipped during the cleanup

  • Enabled: Trash can is skipped
  • Disabled: Trash can is not skipped

Created By

The user who created the policy

Creation Time

The timestamp when the policy was created

Last Modified By

The user who last edited the policy

Last Modification Time

The timestamp when the policy was last edited

Projects

The project name associated with the policy

Included in Projects

The projects to which the policy is assigned

Package Types

Indicates which projects the GLOBAL policy applies to. It includes:

ALL: This option indicates that the policy is shared with all projects. This is selected when the "Include All Projects" checkbox is checked in the policy settings.

N/A: This option indicates that the policy is not applicable to any specific projects.

Note: Applicable for Global Policies only.

Included in Repositories

Excluded from Repositories

The repositories not affected by the policy

Include Package Name Pattern

The name pattern applied to select packages for deleting

Exclude Package Name

The name pattern applied to exclude packages from deleting

Age Condition (older than)

The age-based condition for selecting packages (e.g., older than a specified time)

Usage Condition (not downloaded since)

The condition for selecting packages based on usage (e.g., not downloaded since a certain date)

Version (keep last N)

The number of latest versions to retain; older versions are deleted

Run Detailed Summary

Indicates the detailed cleanup run summary:

  • Package name: The name of the deleted package
  • Version: The version of the deleted package
  • Size: The size of the package on the disk
  • Repository: The repository from which the package was deleted
  • Repository Type: The type of the repository (For example, Local, Federated)
  • Status: The status of the cleanup operation (For example, deleted)
  • Status Message: A brief message indicating the result of the cleanup operation:
    • Successfully Cleaned: Package was successfully deleted
    • Cleanup Failure: Package delete failed. For more details see artifactory-service.log
    • Package Not Found: Package was not found
    • Archived: Package was successfully archived
    • Dry Run Status:
      • Dry run successfully processed the package
      • Dry run failed to process the package
    • Restore Status:
      • Package restore has not been initialized
      • Package was warmed
      • Package was successfully restored
  • Package path: The full path to the package location
  • Created date: The timestamp when the package was created
  • Modified date: The timestamp when the package was last edited
  • Last Downloaded date: The timestamp when the package was last downloaded
  • Following are the release bundle cleanup report fields:

Field

Description

Run General Details

The general details of the cleanup run

cleanup run for <policy-name> <status>

The policy name and current status of the cleanup run.

isDryRun

Indicates whether the run was a dry run or an actual run.

  • True: Dry run (no changes made)
  • False: Actual run (changes applied)

Run Start Time

The timestamp when the cleanup process started

Duration

The total time taken for the cleanup process

Run Summary

The summary of the cleanup run

Cleaned release bundles count

The total number of cleaned release bundles

Total release bundle count

The total number of release bundles processed during the cleanup

Policy Configuration For This Run

Indicates the configuration details of the policy

Policy Key

The name of the cleanup policy used for this run

Description

A description of the cleanup policy

Cron Expression

The cron expression used to schedule the cleanup runs

Max Run Duration

The maximum duration allowed for the policy to run

Created By

The user who created the policy

Creation Time

The timestamp when the policy was created

Last Modified By

The user who last edited the policy

Last Modification Time

The timestamp when the policy was last edited

Projects

The project name associated with the policy

Included in Projects

The projects to which the policy is assigned

Include Release Bundles Names

The names of the selected release bundles for deleting

Age Condition (older than)

The age-based condition for selecting release bundles (e.g., older than a specified time)

Not Promoted to Environments

The release bundle was not promoted to

Run Detailed Summary

Indicates the detailed cleanup run summary

  • Release Bundle name: The name of the deleted release bundle
  • Version: The version of the deleted release bundle
  • Creation Time: The Timestamp at which the release bundle created
  • Created by: The name of the user who created the release bundle
  • Promoted To: The release bundle promoted to environment
  • Status: The status of the cleanup operation (e.g., deleted)
  • Status Message: A brief message indicating the result of the cleanup operation. The Status Message can be one of the following:
    • Successfully Cleaned: Release bundle version was successfully deleted
    • Cleanup Failure: Release bundle version delete failed. For more details see artifactory-service.log
    • Dry Run Status:
      • Dry run successfully processed the release bundle version
      • Dry run failed to process the release bundle version
    • Distribution not installed: Distribution service is unavailable
    • Distribution is installed and the version is never distributed:
      • The release bundle version was successfully deleted
      • The dry run successfully processed the release bundle version
    • Distribution is installed and a version was attempted to be distributed but always failed: Same as above when cleaned
    • Distribution is installed and the version was distributed successfully: Release bundle version is already distributed to one or more edge nodes.
    • Distribution is installed and API returns any other response status code: Unable to validate distribution status due to unknown reasons. For more details, see artifactory-service.log.
  • Following are the build cleanup report fields:

Field

Description

Run General Details

The general details of the cleanup run

cleanup run for <policy-name> <status>

The policy name and current status of the cleanup run.

isDryRun

Indicates whether the run was a dry run or an actual run.

  • True: Dry run (no changes made)
  • False: Actual run (changes applied)

Run Start Time

The timestamp when the cleanup process started

Duration

The total time taken for the cleanup process

Run Summary

The summary of the cleanup run

cleanup builds count

The total number of builds successfully deleted

Total builds count

The total number of builds processed during the cleanup

Builds virtual size

The virtual size of all deleted builds

Builds physical size

The actual physical size of all deleted builds

Policy Configuration For This Run

Indicates the configuration details of the policy

Policy Key

The name of the cleanup policy used for this run

Description

A description of the cleanup policy

Cron Expression

The cron expression used to schedule the cleanup runs

Max Run Duration

The maximum duration allowed for the policy to run

Skip Trash Can

Indicates if the trash can was skipped during the cleanup

  • Enabled: Trash can is skipped
  • Disabled: Trash can is not skipped

Created By

The user who created the policy

Creation Time

The timestamp when the policy was created

Last Modified By

The user who last edited the policy

Last Modification Time

The timestamp when the policy was last edited

Selected Projects

The project name associated with the policy

Include All Projects

The projects to which the policy is assigned

Include Build Names

The name pattern applied to include builds for deleting

Age Condition (older than)

The age-based condition for selecting builds (e.g., older than a specified time)

Delete Build Artifacts

Indicates if the build artifacts are deleted

Run Detailed Summary

Indicates the detailed cleanup run summary:

  • Build name: The name of the deleted build
  • Build number: The number of the deleted build
  • Creation Time: The timestamp at which the build was created.
  • Created By: The user who created the build
  • Artifacts count: The number of the artifacts
  • Artifacts virtual size: The virtual size of artifacts associated with the build
  • Associated Release Bundles: Build associated with the release bundles
  • Status: The status of the cleanup operation (For example, deleted)
  • Status Message: A brief message indicating the result of the cleanup operation:
    • Deleted: Build was successfully deleted
    • Partially Deleted: Build artifacts were partially deleted. X of Y artifacts deleted successfully. Please check the remaining artifacts.
    • Error: Build number delete failed. For more details see artifactory-service.log
    • Skipped: Unable to delete the build number. For more details see artifactory-service.log. Deletion of build number was skipped due to an asociated release bundle. Set a release bundle retention policy first.
    • Dry Run Completed:
      • Dry run successfully processed the build
      • Dry run failed to process the build
    • Dry Run Error: Dry run failed to process the build number

Cleanup Policies System Properties

The following properties can be configured in the Artifactory configuration file $JFROG_HOME/etc/artifactory/artifactory.system.properties.

ParameterDescriptionDefault Value
artifactory.policy.cleanup.csv.file.max.recordsThe number of records per CSV report file.100,000
artifactory.policy.cleanup.nodes_cleaned.expiration.daysThe number of days that deleted artifacts are stored in the temp table that is used for reports (like debug info).30
artifactory.policy.cleanup.nodes_cleaned.job.rate.daysThe frequency (in days) that the clean temp table job checks for expired deleted artifacts.10
artifactory.policy.cleanup.concurrency.maxLevelThe maximum count of threads that can be used for a policy run.5
artifactory.policy.cleanup.batchSizeThe maximum amount of packages that can be requested to be processed at one time.10,000
artifactory.policy.cleanup.partition.sizeThe number of items in a group into which one batch is divided during processing.1,000
artifactory.policy.cleanup.error.threshold.percentThe maximum percentage of errors that can happen in a one-run before the run is stopped.10
artifactory.policy.cleanup.deleted.package.limitThe maximum number of packages that can be processed during one run.100,000