Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sync a local folder with a folder in a Google Cloud Platform bucket? [closed]

I want to sync a folder in one of my buckets (or even the whole bucket) and a local folder in more than one windows computer. I don't mind running some script in the background. Is there any way to do this? I haven't found any resources out there. I've tried using CrossFTP, an FTP client that supports the Google Cloud Platform, but syncing is only available when paying those 30 bucks and I'd rather avoid that to be honest. FileZilla is a nice option too, but I can't seem to get it up and working with Google. Any ideas? Any help or suggestions would be greatly appreciated. Thanks in advance.

like image 973
Cottand Avatar asked Aug 30 '25 18:08

Cottand


2 Answers

You can use gsutil and write a script which can run at intervals to upload/sync

To upload: https://cloud.google.com/storage/docs/gsutil/commands/cp#description

gsutil cp *.txt gs://my-bucket

For sync: https://cloud.google.com/storage/docs/gsutil/commands/rsync

gsutil rsync -d -r data gs://mybucket/data

For your use case, sync up to one of the buckets and then sync back to all of your machines.

To introduce parallelism, use gsutil -m rsync, where the m stands for multithreading.

like image 196
Vikram Tiwari Avatar answered Sep 03 '25 17:09

Vikram Tiwari


To update the available options GCP now offers Data Transfer Service that can be scheduled to move on prem data to the cloud bucket.

like image 44
scubaman31 Avatar answered Sep 03 '25 18:09

scubaman31