# general


12/08/2021, 3:37 PM
Hi - anyone tried to create an azure ACR registry with a scheduled task to cleanup images periodically? it would be a task that first gets the list of repositories, then run an acr purge on those registries the command in the documentation is like this:
Copy code
# Environment variable for container command line
PURGE_CMD="acr purge \
  --filter 'samples/devimage1:.*' --filter 'samples/devimage2:.*' \
  --ago 0d --untagged"

az acr task create --name weeklyPurgeTask \
  --cmd "$PURGE_CMD" \
  --schedule "0 1 * * Sun" \
  --registry myregistry \
  --context /dev/null
I am trying to implement that using but I couldn't find a way to: • Get the names of the acr repositories at each execution • Pass the command as a string