Introduction
The Prune Unreferenced Data (PUD) process can be triggered using a Start PUD Process API call. Depending on your needs, you can either run a dry run (to simulate the cleanup) or an actual run (to remove unreferenced binaries).
Note
This feature is supported only for a Self-Hosted environment.
Dry Run (Preview only)
Running the dry run will show you what would be deleted, without actually deleting anything:
curl -u <username>:<password> -H "Content-Type: application/json" \
-X POST "https://<ARTIFACTORY_URL>/artifactory/api/system/storage/prune/start" \
-d '{ "dryRun": true }'
Actual Run (Performs deletion)
To actually remove unreferenced data:
curl -u <username>:<password> -H "Content-Type: application/json" \
-X POST "https://<ARTIFACTORY_URL>/artifactory/api/system/storage/prune/start"
The prune process can also be started in the UI under Administration → Artifactory Settings → Maintenance, but the dry run is only available via REST API.
In both cases, you’ll receive a confirmation that the task has been submitted.
You can then monitor the progress using the Get Status of the PUD Process API:
curl -u <username>:<password>
http://<ARTIFACTORY_URL>/artifactory/api/system/storage/prune/status
You’ll get a response showing the following details:
{
"status": "finished",
"dryRun": true,
"report": {
"totalBinariesProcessed": 6669,
"totalBinariesCleaned": 0,
"totalBytesCleaned": 0
}
}
Analyzing the Logs
To get deeper insight into the process, you can monitor artifactory-service.log. This shows how the process walks through each directory and checks for eligible files:
[jfrt ] [INFO ] [5dda26d4d34338e8] [o.j.s.b.c.FilestorePruner:122 ] [4d34338e8|art-exec-2] - Prune process will be resumed from directory following 00
[jfrt ] [INFO ] [5dda26d4d34338e8] [o.j.s.b.c.FilestorePruner:186 ] [4d34338e8|art-exec-2] - No files were pruned from dir 00
[jfrt ] [INFO ] [5dda26d4d34338e8] [o.j.s.b.c.FilestorePruner:186 ] [4d34338e8|art-exec-2] - No files were pruned from dir 01
[jfrt ] [INFO ] [5dda26d4d34338e8] [o.j.s.b.c.FilestorePruner:186 ] [4d34338e8|art-exec-2] - No files were pruned from dir 02
[jfrt ] [INFO ] [5dda26d4d34338e8] [o.j.s.b.c.FilestorePruner:186 ] [4d34338e8|art-exec-2] - No files were pruned from dir 03
[jfrt ] [INFO ] [5dda26d4d34338e8] [o.j.s.b.c.FilestorePruner:186 ] [4d34338e8|art-exec-2] - No files were pruned from dir 04
...
[jfrt ] [INFO ] [5dda26d4d34338e8] [o.j.s.b.c.FilestorePruner:216 ] [4d34338e8|art-exec-2] - Prune task has completed with report: Started at 24-11-11T-14:43:35.812+0000, finished at 24-11-11T-14:43:37.531+0000 (took 00:00:01.719) with status FINISHED. 6669 processed, 0 cleaned, 0 bytes cleaned
*In the above example, we did not have eligible candidates for deletion, however, if there are, we will be able to observe them while following the same traceId 5dda26d4d34338e8.
For a complete list of available PUD REST APIs, refer to the official JFrog Artifactory REST API documentation.
Note
This feature is supported in the S3 binary provider starting from Artifactory self-hosted version 7.59.x, and in the Azure and GCP binary providers starting from version 7.63.x.