- you need to move backup of artifactory server from another server it will give you more space.
- USE AQL to manage cleanup issues.
First let’s find old artifacts, those that were created over a year ago (assuming today is May 18, 2015). This one’s easy with AQL:
items.find({"type":"file",
"created":{"$lt":"2014-05-18T"}})
Note how we can use comparison operators like “$lt” with dates, and that we’re taking advantage of the default built into AQL that multiple criteria are compounded using “$and”.
wants to delete something if it hasn’t been downloaded in the last 6 months:So let’s add another criterion to our query, this time using the “downloaded” field in the “stat” domain:
items.find({"type":"file",
"created":{"$lt":"2014-05-18T"},
"stat.downloaded":{"$lt":"2014-11-18T"}})
if you wants to make sure nothing important is deleted, so he will skip “release” repositories.
items.find({"type":"file",
"created":{"$lt":"2014-05-18T"},
"stat.downloaded":{"$lt":"2014-11-18T"},
"repo":{"$nmatch":"*release*"}})
Here, we added a criterion that the repository name does not include the pattern “release”. Note that if you have any repository with “release” in its name – but it’s not a release repository… it will also be skipped, and you may want to rethink your naming convention.
“large” artifacts bigger than 1000 bytes.
So here is the final AQL query that finds all artifacts in the system that answer all of those criteria:
items.find({"type":"file",
"created":{"$lt":"2014-05-18T"},
"stat.downloaded":{"$lt":"2014-11-18T"},
"repo":{"$nmatch":"*release*"},
"size":{"$gt":"1000"}})