Downloading folders from Google Cloud Storage Bucket

狂风中的少年 提交于 2020-01-22 20:53:29

问题


I'm new to Google Cloud Platform.I have trained my model on datalab and saved the model folder on cloud storage in my bucket. I'm able to download the existing files in the bucket to my local machine by doing right-click on the file --> save as link. But when I try to download the folder by the same procedure as above, I'm not getting the folder but its image. Is there anyway I can download the whole folder and its contents as it is? Is there any gsutil command to copy folders from cloud storage to local directory?


回答1:


You can find docs on the gsutil tool here and for your question more specifically here.

The command you want to use is:

gsutil cp -r gs://bucket/folder .



回答2:


Prerequisites: Google Cloud SDK is installed and initialized ($ glcoud init)

Command:

gsutil -m cp -r  gs://bucket-name .

This will copy all of the files using multithread which is faster. I found that the "dir" command instructed for use in the official Gsutil Docs did not work.




回答3:


gsutil -m cp -r gs://bucket-name "{path to local existing folder}"

Works for sure.



来源:https://stackoverflow.com/questions/44406729/downloading-folders-from-google-cloud-storage-bucket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!