How can I completely remove artifacts from Artifactory?

Subject

Use this article to learn how to completely delete artifacts from Artifactory and how Artifactory delete process works.

Description

This article will be useful if you

  • are wondering why the delete operation does not free up disk space in Artifactory
  • want to know how Artifactory deletion work

Please note that deleting massive number of artifacts can use up resources such as Database and disk IO, so it could be important to run large deletes during off-hours or delete items by chunk.

Resolution

1. You may delete an artifact or a build via Artifactory GUI or following REST APIs with a user that has Delete permission to the resource

2. Please note that artifacts do not get removed from storage immediately if you have Trash Can feature enabled (enabled by default). If you would like to delete the artifacts from the Trash Can, you may delete it from the Artifact browser or by running following REST APIs.

3. Even after above steps, Artifactory does not immediately free up filestore because Artifactory runs the delete operation during its Garbage Collection and only if the binary is not referenced anywhere in the database.

Related reference:
https://www.jfrog.com/confluence/display/RTF/Managing+Disk+Space+Usage
https://github.com/JFrog/artifactory-user-plugins/tree/master/cleanup/artifactCleanup