1. 程式人生 > >How to download all files from Google Cloud Storage. « 關於網路那些事...

How to download all files from Google Cloud Storage. « 關於網路那些事...

How to back up GCP Storage file and folder to local?

Here I'm using gsutil tool command line tool to download all file to local.

Install gsutil

First, you need install gsutil tool in your local environment.

curl https://sdk.cloud.google.com | bash

Restart your shell after installed.

exec -l $SHELL

Initialize gcloud environment:

gcloud init

Now, your can create a local folder for backup gcp storage file.

Download file

For example, download mypicture.png from bucket to local:

gsutil -m cp -R gs://BUCKETNAME/mypicture.png ~/my_local_folder/

Download folder

gsutil -m cp -R gs://BUCKETNAME ~/my_local_folder
/

如果你喜歡我們的文章內容,請在這裡按個讚