I´m using this spec file to delete old artifacts of more than 3 months.
{
"files": [{
"aql": {
"items.find": {
"$or": [{
"$and": [{
"repo": "repo1",
"created": {
"$before": "3mo"
}
}],
"$and": [{
"repo": "repo2",
"created": {
"$before": "3mo"
}
}],
"$and": [{
"repo": "repo3",
"created": {
"$before": "3mo"
}
}]
}]
}
}
}]
}
but I want to remove the hole folders that begins with: "2019*" like is showed in the picture which contains the artifacts, and no just the artifacts in the folder.
I tried with following but I didn´t work:
"items.find": {
"repo": "repo1",
"path": "com/domain/name",
"name": {"$match":"20*"},
"type": "folder",
Says no artifact founded.
Also is there a way with Jfrog to delete all artifacts except last 2? Just want to keep last 2 instead of having all and have to delete them with this script every certain time
Thanks!!
FOR more than one repo?
{
"files": [{
"aql": {
"items.find": {
"$or": [{
"$and": [{
"repo": "repo1",
"path": "com/foo/bar",
"created": {
"$before": "3mo"
}
"type": "folder",
"name": {"$match":"20*"}
}],
"$and": [{
"repo": "repo2",
"path": "com/foo/bart",
"created": {
"$before": "3mo"
}
"type": "folder",
"name": {"$match":"20*"}
}],
"$and": [{
"repo": "repo3",
"path": "com/foo/bar",
"created": {
"$before": "3mo"
}
"type": "folder",
"name": {"$match":"20*"}
}]
}]
}
}
}]
}
