s5cmd icon indicating copy to clipboard operation
s5cmd copied to clipboard

Unable to cp s3 prefix -> local when source has an asterisk

Open bforcier1 opened this issue 3 years ago • 0 comments

When trying to download a prefix with an asterisk in the path, I get an error indicating that the destination can't have a wildcard

-bash-4.2$ s5cmd cp 's3://bucket/junk*star/workspace/*' '/tmp/junk*star/workspace'
ERROR "cp s3://bucket/junk*star/workspace/* /tmp/junk*star/workspace": target "/tmp/junk*star/workspace" can not contain glob characters

Setting --raw would help with the destination, but then the S3 source is treated like a object instead of prefix

-bash-4.2$ s5cmd cp --raw 's3://bucket/junk*star/workspace/*' '/tmp/junk*star/workspace'
ERROR "cp s3://bucket/junk*star/workspace/* /tmp/junk*star/workspace": NoSuchKey: The specified key does not exist. status code: 404, request id: K9PZSE272D6FKN2E, host id: 35CmmMj9irkX5rwcaGi29Wu4SDsyKuRBgt2TaVcYU2ESi9lIHohudYpIebJXjl7saC22S6CBYvk=

Is there an option to have s5cmd not take a stance wildcard characters, but allow downloading of an S3 prefix? Something like -r/--recurisve for the source is what I would have expected, but I don't see such an option.

Thanks

bforcier1 avatar Aug 26 '22 13:08 bforcier1