Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automatically delete old artifacts from some repositories in Artifactory

Tags:

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 !

like image 868
user3232823 Avatar asked Dec 30 '25 13:12

user3232823


1 Answers

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.

like image 147
Ariel Avatar answered Jan 01 '26 13:01

Ariel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!