s3cmd get an entire directory

hogsolo picture hogsolo · Mar 28, 2015 · Viewed 18.5k times · Source

I have a directory in my s3 that has only another directory inside it, but I don't know it's name. Using command line "get" tools, i'd like to download that directory, but it doesn't seems to want to.

The structure looks like: my-production/top-dir/sub-dir/some-files.jpg then s3cmd get s3://my-production/top-dir/* local-dir

The "sub-dir" directory does not download. Do I have to get the directory name, make the directory locally, then "get" all it's contents?

Answer

Adam Dobrawy picture Adam Dobrawy · Aug 27, 2016

You have to pass parameter --recursive eg. s3cmd get --recursive s3://my-production/top-dir/ local-dir.