skip to Main Content

Will aws s3 sync s3://myBucket/this_folder/object_file C:\UsersDesktop create also the "this_folder" in C:UsersDesktop? If not, what would be the solution to copy/sync including the folder structure of S3? I mean I have many files in different S3 bucket folders sorted by year, month, day. I would like to copy them locally with the folder structure/tree to be created locally as it is in the S3 bucket. Thank you.

2

Answers


  1. Use the aws cli with the --recursive argument.

    For example:

    aws s3 cp --recursive s3://your_bucket/your_folder_named_x path/to/your/destination
    
    Login or Signup to reply.
  2. Will aws s3 sync s3://myBucket/this_folder/object_file C:UsersDesktop create also the "this_folder" in C:UsersDesktop?

    Yes, it will. aws s3 sync is recursive by default.

    You may want to consider adding the --delete option to make sure that the local directory C:UsersDesktop does not have deprecated files that are no longer in the bucket.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search