'Deleting old artifacts from a list of repositories

I am trying to delete artifacts ( older than 6 months) from a list of repositories in jfrog artifactory. I am creating a spec file like below and using that spec i am deleting using jfrog cli. My query is there any way i can execute the aql in loops instead of manually updating the repo name: foobar

 {
  "files": [
    {
      "aql": {
        "items.find": {
          "repo": "foobar",
          "$or": [
            {
              "$and": [
                {
                  "modified": { "$lt": "2021-06-06T21:26:52.000Z"}
                }
              ]
            }
          ]
        }
      }
    }
  ]
}```
jfrog rt del --spec /tmp/foo.spec --dry-run

I want to run the aql in loops only change will be the repo name . Is there a way to do it ?


Solution 1:[1]

You may also want to consider using the JFrog-CLI plugin: https://github.com/jfrog/jfrog-cli-plugins/tree/main/rt-cleanup Which is a bit more easy than the file-spec approach. All you need to do is to install the plugin:

jf plugin install rt-cleanup

and then delete the old artifacts:

jf rt-cleanup clean example-repo-local --time-unit=month --no-dl=6

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Talar