Guest User

Untitled

a guest
Apr 25th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. BUCKET_NAME=some_bucket
  2. PATTERN='some_pattern'
  3.  
  4. aws s3 ls --recursive s3://${BUCKET_NAME} | rev | cut -f1 -d' ' | rev > file_lst
  5.  
  6. cat file_lst | grep -oP "$PATTERN" | xargs -I{} echo "aws s3 rm --recursive 's3://${BUCKET_NAME}/{}'" > rm_cmd.sh
Add Comment
Please, Sign In to add comment