Overview
In earlier versions of Artifactory, files that failed to upload (due to issues such as network problems, out-of-memory errors, or other failures) were not automatically deleted.
These stalled files can negatively impact both performance and costs, as they accumulate and consume significant storage space. Hundreds or even millions of stalled files can lead to unnecessary resource consumption, affecting Artifactory's performance and incurring higher storage costs.
Resolution
Identifying Stalled Files:
1. Locate the _pre Directory: To find the _pre directory, you can use the following command:
sudo find / -type d -name "_pre"
2. Check the Size of the _pre Directory: To check the size of the _pre directory and its contents, use:
sudo du -sh ./_pre
3. Count the Number of Files Older Than One Day: To determine how many files in the _pre directory are older than one day, execute:
sudo find ./_pre -type f -mtime +1 | wc -l
Housekeeping: Delete Stalled Files Older Than One Day
If you find that there are numerous stalled files older than one day, you can delete them using the following command:
sudo find ./_pre -type f -mtime +1 -exec rm -f {} + Note
Use the delete command with extreme caution, as it will permanently remove files older than one day from the _pre directory.
It's advisable to perform a backup or carefully review the files before executing the delete command to prevent unintentional data loss.
Conclusion
Regularly monitoring and housekeeping stalled files in the _pre directory can help improve Artifactory's performance and reduce unnecessary financial costs associated with excess storage use.
Note: Please monitor upcoming Artifactory release notes, as an automatic cleaning task will be implemented.