Post

Get Data from Google Storage

Get Data from Google Storage

Software

  • Install gcloud with gsutil included

Login google cloud using json file

document: https://cloud.google.com/sdk/gcloud/reference/auth/activate-service-account

1
2
gcloud auth activate-service-account test@test.iam.gserviceaccount.com --key-file=./secret.json

Copy data

Reference this document for details: https://cloud.google.com/storage/docs/gsutil/commands/cp

Copy bucket data to local

1
gsutil -m cp -r gs://my-bucket/data ./data

rsync data

Reference this document for details: https://cloud.google.com/storage/docs/gsutil/commands/rsync

Sync local data from bucket

1
gsutil -m rsync -d -r gs://mybucket/data  ./data
This post is licensed under CC BY 4.0 by the author.