Need a G-Drive account to sync with a GCS bucket.

Sany Huttler
Sany Huttler used Ask the Experts™
on
Hi,
I have a GCS bucket setup which receives images and media files.
Ideally I would like to have a live sync between this bucket and a G-Drive account without the need for a local download first.
As a compromise I'd be willing to consider a scheduled solution instead of a live link. So if a new file appears on the GCS Bucket it is copied to the equivalent folder on the G-Drive.

In both cases I only want the sync or transfer to ADD new files not mirror the bucket and objects. Also which ever solution is best it must be a direct link between the two as opposed to a solution that downloads the objects locally before uploading to the G-Drive.


Hope that all makes sense but please let me know if you need anything else.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016

Commented:

Author

Commented:
Thanks David,
Using transfer you can only transfer into the GCS bucket, not out of it to G-Drive.
I need to be able to copy files from GCS buckets.
Martin NguyenHelpDesk Technician
Distinguished Expert 2018

Commented:
Hi Sany,

It does not look like Google natively supports using your buckets to send files to G Drive.

I'll look into this further to see what else I can find.

Author

Commented:
Thanks Martin,
Yes, I was hoping an expert on here had a way around that.
The only viable solution is to have a GCS event automatically trigger a copy to gdrive function.
Fortunately, there is a way, by using Google Cloud Functions.

A google cloud function can be triggered by an event on GCS, and given the correct permissions it definitely can access your G-Drive.

I do it all of the time on AWS with Lambda functions, but unfortunately have no working example on google.

https://cloud.google.com/functions/docs/calling/storage
https://cloud.google.com/functions/docs/writing/background
https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/functions/helloworld/main.py

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial