Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

s3cmd get an entire directory

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?

like image 333
hogsolo Avatar asked Mar 28 '15 00:03

hogsolo


People also ask

Are there directories in S3?

Directories don't actually exist within S3 buckets. The entire file structure is actually just one flat single-level container of files. The illusion of directories are actually created based on naming the files names like dirA/dirB/file .

What is S3cmd sync?

Program S3cmd can transfer files to and from Amazon S3 in two basic modes: Unconditional transfer — all matching files are uploaded to S3 (put operation) or downloaded back from S3 (get operation). This is similar to a standard unix cp command that also copies whatever it's told to.

What is S3cmd used for?

S3cmd ( s3cmd ) is a free command line tool and client for uploading, retrieving and managing data in Amazon S3 and other cloud storage service providers that use the S3 protocol, such as Google Cloud Storage or DreamHost DreamObjects. It is best suited for power users who are familiar with command line programs.

Is there a limit to the number of files in S3 bucket?

S3 provides unlimited scalability, and there is no official limit on the amount of data and number of objects you can store in an S3 bucket. The size limit for objects stored in a bucket is 5 TB.


1 Answers

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

like image 117
Adam Dobrawy Avatar answered Sep 20 '22 14:09

Adam Dobrawy