Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud - Downloading data from bucket to instance

I'm trying download the whole data from my bucket (tracking-data) on google cloud to my instance (instance-1) on Linux system.

I see some options here: https://cloud.google.com/compute/docs/instances/transfer-files#transfergcloud but I'm not sure there's a way there to download from bucket to instance.

I'm accessing my instance through my terminal and I've made a few tries with gsutil, but not successfully so far. Any idea how can I download the whole bucket into my instance? (preferably to put it in MDNet/data, I don't have such directory yet, but I probably should store the data there).

like image 979
Niminim Avatar asked Oct 17 '25 22:10

Niminim


1 Answers

First of all, check the API access rights for your Compute Engine service account:

enter image description here

For instance, read only:

enter image description here

Then, just use gsutil cp (doc) or even gsutil rsync (doc):

gsutil -m cp -r gs://<your-bucket>/* <destination_folder> 

Disclaimer: Comments and opinions are my own and not the views of my employer.

like image 101
vdenotaris Avatar answered Oct 20 '25 23:10

vdenotaris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!