且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Google Cloud Storage 中下载多个文件

更新时间:2023-01-07 08:18:11

I would suggest downloading the files with gsutil. However if you have a large number of files to transfer you might want to use the gsutil -m option, to perform a parallel (multi-threaded/multi-processing) copy:

gsutil -m cp -R gs://your-bucket .

The time reduction for downloading the files can be quite significant. See this Cloud Storage documentation for complete information on the GCS cp command.

If you want to copy into a particular directory, note that the directory must exist first, as gsutils won't create it automatically. (e.g: mkdir my-bucket-local-copy && gsutil -m cp -r gs://your-bucket my-bucket-local-copy)