Created
November 21, 2017 10:34
-
-
Save floehopper/ceed820ec6a2502200ac7d1faf41a4c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ aws s3api list-objects-v2 --bucket govuk-assets-integration --query 'Contents[?length(@.Key) == `24`].[Key]' --output text >orphan-s3-object-keys.txt | |
$ cat orphan-s3-object-keys.txt | wc -l # => 1137 | |
$ cat orphan-s3-object-keys.txt | xargs -I {} aws s3api delete-object --bucket govuk-assets-integration --key {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment