amazon s3 - howto abort all incomplete multipart uploads for a bucket -


sometimes multipart uploads hang or don't complete reason. in case stuck orphaned parts tricky remove. can list them with:

aws s3api list-multipart-uploads --bucket $bucketname 

i looking way abort them all.

assuming have awscli setup , it'll output json can use jq project needed keys with:

bucketname=<xxx> aws s3api list-multipart-uploads --bucket $bucketname \ | jq -r '.uploads[] | "--key \"\(.key)\" --upload-id \(.uploadid)"' \ | while read -r line;     eval "aws s3api abort-multipart-upload --bucket $bucketname $line"; done 

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -