user3232823
user3232823

Reputation: 1887

How to automatically delete old artifacts from some repositories in Artifactory

We are at Artifactory version 4.12.2. If i have ten local repositories and i want to keep only latest twenty artifacts in five repositories and unlimited in other five repositories. Need suggestion how i may achieve it. I attempted to use plugin(groovy) available from jfrog website, but seems like that will imply deletion rule for all repositories. Appreciate suggestions !

Upvotes: 3

Views: 863

Answers (1)

Ariel
Ariel

Reputation: 3506

You can define a set of repositories for the plugin to run on by adding the properties file, in case you are talking about the artifactCleanup.groovy file. The properties file, artifactCleanup.properties, should look like that:

policies = [ 
               [ "	0 0 12 1/1 * ? *", [ "libs-releases-local" ], 3 ], 
           ]

This holds both the cron expression that let the plugin know when to run and the repositories name.

In this specific example, the plugin will run every day at 12PM.

Upvotes: 2

Related Questions