ARTIFACTORY: How to temporarily disable Garbage Collection?

ARTIFACTORY: How to temporarily disable Garbage Collection?

AuthorFullName__c
Elina Floim
articleNumber
000005770
FirstPublishedDate
2023-06-07T08:55:16Z
lastModifiedDate
2023-06-07
VersionNumber
1

In certain scenarios, such as during an Artifactory migration, the garbage collection job needs to be temporarily disabled in order to avoid the cleanup of artifacts during the migration process. The Garbage Collection job cannot in fact be disabled, however, it can be configured to run after the migration is complete. In order to do that, the CRON expression can be increased to ensure the migration is complete until the configured date. For example, the CRON expression can be set as follows in order to set the next GC run to in 2030:
0 0 0 ? * * 2030/1

After the migration is complete, the expression should be set to the default expression (or any other desired expression). The CRON expression can be also changed via the Artifactory YAML configuration:
gcConfig:   #Garbage collection settings
  cronExp: "0 0 0 ? * * 2030/1"

CRON expressions can be generated by online Quartz CRON expression generators, such as this

Note: Garbage Collection is a vital maintenance procedure in Artifactory meant to ensure the system does not become clogged with unused binaries. Setting such extended intervals is not recommended as part of the day-to-day Artifactory maintenance and should be utilized only when necessary.