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?
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 .
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.
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.
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.
You have to pass parameter --recursive
eg. s3cmd get --recursive s3://my-production/top-dir/ local-dir
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With