-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to delete object versions? #386
Comments
s5cmd doesn't have version support currently. |
You're right, s5cmd does not support versioning-enabled buckets. The simplest way to do it seems to be using s3 console (as you said) or using alternatives such as s3wipe. AWS CLI does not support emptying versioning-enabled buckets or deleting versioning-enabled buckets, though it migt be achieved by using Adding versioning support to s5cmdFew notes
Review of various CLI toolsMinio CLIRich support
s4cmdfew or no support
aws s3few or no support
gsutilMedium to rich support, though has "generation number" instead of "version id s"
Proposal
|
@igungor @kucukaslan , when can we expect this feature to be released? This issue has been closed as completed, but I still can't delete object versions with the latest release. $ s5cmd version
v2.1.0-beta.1-3e08061
$ s5cmd ls --all-versions "s3://${bucket}"
Incorrect Usage: flag provided but not defined: -all-versions
... I use this setup to test it in my own account. bucket=$"isme-$(gpw 1 8)"
aws s3api create-bucket \
--bucket "$bucket"
aws s3api put-bucket-versioning \
--bucket "$bucket" \
--versioning-configuration Status=Enabled
printf "key" > /tmp/key
aws s3api put-object \
--bucket "$bucket" \
--key key \
--body /tmp/key |
Sorry for the confusion. It was closed since the relevant PR was merged to master where development happens. But the new release including that PR isn't out yet (for the moment you may try building/installing from master). Unfortunately, I don't know when it will be released; but hope it to be soon. |
@iainelder it is released with |
Awesome, thank you both! Now I can delete object versions like this: $ s5cmd ls --all-versions "s3://${bucket}"
2023/06/19 12:38:56 3 key s2K4Rjx_HMjp0k.KnEO9l_yKuh3SXh4P
$ s5cmd rm --all-versions "s3://${bucket}/*"
rm s3://isme-.../key s2K4Rjx_HMjp0k.KnEO9l_yKuh3SXh4P
$ s5cmd ls --all-versions "s3://${bucket}"
ERROR "ls --all-versions=true s3://isme-...": no object found |
I want to delete a non-empty bucket that has versioning enabled.
To do that in the S3 console first I would
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.
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.
The text was updated successfully, but these errors were encountered: