问题
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