In the Live Artifactory instance, go to the Administration module, and select Artifactory | Retention Policies and click Create Policy.
The Create New Retention Policy page appears.
Under Archiving Criteria, select Archive Artifacts.
The settings for archiving artifacts are displayed.
Configure the following details:
Field
Description
Policy Name
Provide a unique and meaningful name for the policy.
Schedule Execution
Use a cron expression to set the schedule for the policy to execute.
Example:
Max Execution Duration
Enable and select the maximum duration that the policy has to execute. While this is useful for adhering to a strict archiving schedule, it can cause the archive policy to stop before completion.
Active Policy
Select the checkbox to make this an active policy. Clear the checkbox if you do not want the policy to run according to schedule.
Artifacts
Include Repository
Type a repository name and then click Add to include it in the policy.
If you add more than one repository, the And/Or toggle offers you following options:
Choose Or if you want to archive all selected repositories if at least one of them contains an artifact with a specific name pattern or property.
Choose And if you want to archive all selected repositories only if they all contain an artifact with a specific name pattern or property.
Note
In addition to Include Repository, the other following settings have the And/Or toggle: Exclude Repository, Include/Exclude Path Pattern, Include/Exclude Artifact Name Pattern, Include/Exclude Property Name and Value.
Exclude Repository
If you want to exclude one or more repositories from repositories that you included, click Add to add repositories that you want to exclude.
Include Path Pattern
Click Add to add path patterns that you want to include in the policy.
Exclude Path Pattern
If you want to exclude one or more path patterns from path patterns that you included, click Add to add path patterns that you want to exclude.
Include Artifact Name Pattern
Click Add if you want to archive only artifacts with a specific name pattern.
Exclude Artifact Name Pattern
If you want to exclude one or more artifact name patterns from artifact name patterns that you included, click Add to add name patterns that you want to exclude.
Properties
Include Name and Value
Click Add if you want to archive only artifacts that have a property with a specific name and value. pattern.
Exclude Name and Value
If you want to exclude one or more artifact properties from artifact properties that you included, click Add to add the properties that you want to exclude.
Age
Deployed before
Enable this setting if you want to archive artifacts based on when they were last deployed. For example, archive artifacts that were deployed a year ago.
Last downloaded before
Enable this setting if you want to archive artifacts based on when they were last downloaded. For example, select artifacts that were downloaded a year ago.
Convert to AQL
Click Convert to AQL to use Artifactory Query Language (AQL) queries to select the artifacts that you want to archive.
Important
If you convert to AQL, this permanently changes how you configure the archive policy in the future. Once you choose to configure an archive policy using AQL, you will not be able to use the UI to change settings in the Artifacts, Properties, and Age sections of the UI (however, you will be able to change those settings in the AQL code).
Deletion Settings
Skip Trash Can
Enable this setting if you want to prevent transferring artifacts to the trash can repository when artifacts are archived to the Cold Instance. Enabling this setting will cause artifacts to be permanently deleted from the Live Instance after the archiving process is complete.
Purge Artifacts from Archive
Specify if and when archived artifacts should be permanently deleted from the archive:
Select Never to never delete archived artifacts.
Select After to delete the archived artifacts after a specific period that you define.
Description
If required, add a description for the policy.
Click Preview to get an estimate of the number of artifacts that will be archived based on the settings selected for the policy.
Click Save to save the policy. The policy will run on the scheduled date and time.
The newly created policy appears in the Retention Policies list.