3

I have the proper access and role in IAM. I have administrator access. My aws s3 ls command works alright. I have done aws configure as well. But when I run the command :

aws s3 sync s3://my-bucket local_destination_folder

It only downloads until the last folder of the bucket and that folder is empty. I even tried the aws s3 cp command with --recursive switch, but nothing gets downloaded. I don't get any error as well.

2
  • 1
    Could you clarify what do you mean by "It only downloads until the last folder of the bucket and that folder is empty"? So it downloads partially from the bucket?
    – Marcin
    Commented May 6, 2020 at 12:13
  • @Marcin Say my bucket is structured as : my-bucket/a/b/c/ and inside /c I have the files. The sync command only downloads the skeletons, i.e. /a/b/c/ . And as for cp command, it does not download even the folder structure. Commented May 6, 2020 at 12:19

2 Answers 2

7

I had same result, but the error was how I was setting the command for sync.

a) From local to S3 Bucket: Eg. create a file 'hi.txt' inside this path '/home/ec2-user/src_folder'

The sync command should be similar as:

aws s3 sync src_folder s3://your-bucket/dest_folder

Verify your files with:

aws s3 ls s3://your-bucket/dest_folder/

b) From S3 bucket all content to local

aws s3 sync s3://your-bucket .
0

I had the same issue, turns out windows is case insensitive so the path used in s3://.. is case sensitive. So make sure your s3 path all cases are as per the s3 bucket.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.