peak / s5cmd

Parallel S3 and local filesystem execution tool.
MIT License
2.7k stars 239 forks source link

[Feature] `s5cmd cp` all versions of a single key #762

Open skeggse opened 1 month ago

skeggse commented 1 month ago

I sometimes have a bucket with versioning enabled, and I want to get copies of all the versions of a given object key. I can do that by using aws s3api list-object-versions, extracting the VersionId, and then execing s5cmd cp --version-id <id> over all the versions, but this seems like a problem s5cmd could solve directly - provide a --all-versions option, or accept some --versions-file containing all the versions I want to download - without requiring a bunch of process execution overhead!

kucukaslan commented 5 days ago

how should that work?

s5cmp cp s3://bucket/key .

will download it to

./key

but if all versions needs to be downloaded file name cannot be inferred from the key. So there should be a way to map different versions to different file names.