Skip to content

Instantly share code, notes, and snippets.

@david2331
Last active January 3, 2020 16:16
Show Gist options
  • Save david2331/33701bec2e64352df100e37c431802fb to your computer and use it in GitHub Desktop.
Save david2331/33701bec2e64352df100e37c431802fb to your computer and use it in GitHub Desktop.
Shell script to loop through and delete s3 bucket subfolder
for m in 01 02 03 04 05 06 07 08 09 10 11 12
do
for i in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 27 28 29 30 31;
do
aws s3 rm s3://[bucketname]/2017$m$i --recursive;
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment