31

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?

hogsolo
  • 13,565
  • 6
  • 24
  • 25

3 Answers3

56

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

WattsInABox
  • 4,548
  • 2
  • 33
  • 43
Adam Dobrawy
  • 1,145
  • 13
  • 14
1

aws s3 sync s3://bucket-name my-local-dir

Marco Bonelli
  • 63,369
  • 21
  • 118
  • 128
holmb
  • 562
  • 1
  • 5
  • 10
-2

you have to use "sync" instead of "get"

hogsolo
  • 13,565
  • 6
  • 24
  • 25
  • 1
    nope, spoke to soon, you really have to pay attention to the paths. s3cmd get --recursive --force s3://bucket/subdirwithothersubdirsinit/ localbucket/subdirwithothersubdirsinit/ will pull all files and "subdirectories" . – hogsolo Mar 29 '15 at 23:09