Manage Cleanup Policies

You can view, search, edit, enable, disable, dry run, run, stop, and delete cleanup policies in Artifactory. Each section describes the UI steps and links to the equivalent REST API.

Supported Actions

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 related policy details.

To get all cleanup policies using the REST API, see Package or Release Bundle. To get cleanup policies of any type, including Build, see Get All Cleanup Policies View.

To view all the Cleanup policies:

  1. From the Administration module, select Artifactory Settings > Retention Policies.

  2. In the Retention Policies page, click Cleanup.

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

Cleanup Policy Table Fields

The policies list includes these columns:

  • Policy Name: The name of the policy.
  • Object Type: The type of object. It can be Packages, Release Bundles, or Builds.
  • Global: Whether the policy is global. A global policy may affect multiple projects. A Platform Admin can manage it on the Global Scope only.
  • Project: The name of the project. Include only repositories that are not assigned to a project: Only repositories not assigned to a project will be affected.
  • Last Run Status: The status of each policy execution:
    • 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. Check 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: When the last run was executed.
  • Next Run: The next scheduled run.
  • Enabled: Whether the policy is enabled or disabled:
    • Enabled: The policy has been enabled. You can run the policy manually, or it runs according to the defined schedule.
    • Disabled: The policy has been disabled. You can perform a dry run, but not a manual or scheduled run.

More Actions

From the more icon, you can perform these actions on a policy:

IconActionDescription
RunManually run the enabled policy.
Dry RunReview which packages will be deleted on the actual run.
EditEdit the policy to make necessary changes.
StopStop a running policy.
Download Last ReportAfter the run completes, download the last run report for that Last Run Status.
  • For Actual Run: What packages were deleted for the actual run.
  • For Dry Run: What packages will be deleted on the actual run.
DeleteDelete the policy from the system.

Customize Table Columns

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

To display and arrange the columns:

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

  2. In the Customize Columns dialog, select which columns to display and drag them to reorder.

  3. Click Apply.

Refresh Policies

To refresh policies, click the Refresh icon in the top-right corner of the table header.

Search Cleanup Policy

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

To get a single cleanup policy by key using the REST API, see Package, Release Bundle, or Build.

Permissions: Only a Platform Admin or a Project Admin can search cleanup policies. A Project Admin can search within their project.

To search the Cleanup policy:

  1. From the Administration module, select Artifactory Settings > Retention Policies.

  2. In the Retention Policies page, click Cleanup.

  3. 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.

To run a cleanup policy using the REST API, see Package, Release Bundle, or Build.

Permissions: Only a Platform Admin or a Project Admin can perform a dry run. A Project Admin can perform a dry run within their project.

📘

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:

  1. From the Administration module, select Artifactory Settings > Retention Policies.

  2. In the Retention Policies page, click Cleanup.

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

  4. 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.

To enable or disable a cleanup policy using the REST API, see Package, Release Bundle, or Build.

Permissions: Only a Platform Admin or a Project Admin can enable or disable a cleanup policy. A Project Admin can do this within their project.

📘

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, see Perform Dry Run Cleanup Policy.

The following actions can be performed on a disabled policy:

To Enable or Disable the Cleanup policy:

  1. From the Administration module, select Artifactory Settings > Retention Policies.

  2. In the Retention Policies page, click Cleanup.

  3. 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.

To disable all cleanup policies using the REST API, see Disable All Cleanup Policies.

Permissions: Only a Platform Admin can disable all cleanup policies, and only from the global context.

📘

Note

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

To disable all the Cleanup policies:

Depending on your role, you can work with the following contexts:

  • 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.

To run a cleanup policy using the REST API, see Package, Release Bundle, or Build.

Permissions: Only a Platform Admin or a Project Admin can run a cleanup policy manually. A Project Admin can run a policy within their project.

📘

Note

To manually run a cleanup policy, the policy must first be activated. For more information, see Enable/Disable Cleanup Policy.

To run the Cleanup policy manually:

  1. From the Administration module, select Artifactory Settings > Retention Policies.

  2. In the Retention Policies page, click Cleanup.

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

  4. 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. For more information, see 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 a run report using the REST API, see Download Cleanup Policy Run Report.

Permissions: Only a Platform Admin or a Project Admin can download the last run report. A Project Admin can download a report within their project.

To download the report:

  1. From the Administration module, select Artifactory Settings > Retention Policies.

  2. In the Retention Policies page, click Cleanup.

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

    A zip file is downloaded containing one or more .csv files.

  4. Review the downloaded report. For more information, see 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.

To stop a running cleanup policy using the REST API, see Stop a Running Cleanup Policy.

Permissions: Only a Platform Admin can stop a running cleanup policy.

📘

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:

  1. From the Administration module, select Artifactory Settings > Retention Policies.

  2. In the Retention Policies page, click Cleanup.

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

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

Stop All Cleanup Policy Runs

Platform Admins can stop all currently running policies from both the Policies tab and the Runs tab. Once a policy run is stopped, it cannot resume from its last point. You must restart the policy from the beginning to rerun it.

To stop all running cleanup policies using the REST API, see Stop All Running Cleanup Policies.

Permissions: Only a Platform Admin can stop all running policies, and only from the global context.

📘

Note

The option to stop all running policies is not available to Project Admins. The Stop All Runs option can be viewed in the global context only.

To stop all Cleanup policy runs:

  1. From the Administrator module, select Artifactory Settings > Retention Policies.

  2. The Retention Policies page appears.

  3. In the Retention Policies page, click Cleanup.

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

    Stop All Runs dialog appears.

  5. 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.

To update a cleanup policy using the REST API, see Package or Build.

Permissions: Only a Platform Admin or a Project Admin can edit a cleanup policy. A Project Admin can edit a policy within their project.

📘

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:

  1. From the Administration module, select Artifactory Settings > Retention Policies.

  2. In the Retention Policies page, click Cleanup.

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

    The <Policy Name> Cleanup Policy page appears.

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

Delete Cleanup Policy

If you decide that a cleanup policy is no longer needed, you can delete it.

To delete a cleanup policy using the REST API, see Package, Release Bundle, or Build.

Permissions: Only a Platform Admin or a Project Admin can delete a cleanup policy. A Project Admin can delete a policy within their project.

📘

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:

  1. From the Administration module, select Artifactory Settings > Retention Policies.

  2. In the Retention Policies page, click Cleanup.

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

    The Delete Policy dialog appears.

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

    The policy is deleted and removed from the Policies list.

FAQs

The following are frequently asked questions about managing cleanup policies in JFrog Artifactory.

plusFAQs
Q: Are new cleanup policies enabled by default?

A: No. Newly created cleanup policies are disabled. Turn a policy on with the Active toggle so that it runs on its schedule or when you run it manually. See Enable/Disable Cleanup Policy.

Q: Should I run a dry run before I enable a policy?

A: Yes. A dry run shows which items the policy would delete without deleting them. Review the report before you enable the policy to prevent unintended deletion. See Perform Dry Run Cleanup Policy.

Q: Who can manage cleanup policies?

A: Platform Admins can manage cleanup policies in any project. Project Admins can manage policies only in their own project. Only a Platform Admin can disable all policies or stop all runs, and only from the global context. See Disable All Cleanup Policies and Stop All Cleanup Policy Runs.

Q: Can I edit or delete a policy while it is running?

A: No. You can't update or delete a running policy. Wait for the run to finish, or stop it first. See Edit Cleanup Policy, Delete Cleanup Policy, and Stop a Running Cleanup Policy.

Q: Can I resume a policy that I stopped?

A: No. A stopped policy can't resume from the point where it stopped. To run it again, start it from the beginning. See Stop a Running Cleanup Policy.

Related Topics


Did this page help you?