简体   繁体   中英

Copy objects with different prefixes from AWS S3 bucket to local host will create folders locally?

Will aws s3 sync s3://myBucket/this_folder/object_file C:\\Users\Desktop create also the "this_folder" in C:\Users\Desktop? 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.

Will aws s3 sync s3://myBucket/this_folder/object_file C:\Users\Desktop create also the "this_folder" in C:\Users\Desktop?

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:\Users\Desktop does not have deprecated files that are no longer in the bucket.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM