-
-
Save drewmace/ac44a8aa4e92083819413b9abbe51a3f to your computer and use it in GitHub Desktop.
How to recursively delete Amazon S3 zero byte files from buckets
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
s3cmd ls --recursive s3://BUCKET_NAME | ruby -rdate -ne 'date, time, size, uri = $_.split; puts uri if size == "0"' | xargs s3cmd del |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment