Skip to content

How to delete object versions? #386

@iainelder

Description

@iainelder

I want to delete a non-empty bucket that has versioning enabled.

To do that in the S3 console first I would

  1. use the "Empty Bucket" option
  2. use the "Delete Bucket" option

I see that to cover step 2 s5cmd has an rb command.

To cover step 1, I tried to use the rm command with syntax like this: s3://bucketname/*

It placed a delete marker on all the objects in the bucket, but it didn't permanently delete any verisons.

So S3 still considers the bucket non-empty, and so step 2 fails.

$ s5cmd rm s3://bucketname/*
rm s3://bucketname/...
...

$ s5cmd rb s3://bucketname
ERROR "rb s3://bucketname": BucketNotEmpty: The bucket you tried to delete is not empty. You must delete all versions in the bucket. status code: 409, request id: XXXXXXXX, host id: XXXXXXX

I don't see an option for permanent deletion in the rm command help.

Am I missing something?

I'm using version v1.4.0-d7a0dda.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions