How can i transfer files from Google drive to Object storage
I'm looking for a way that i connect linode object storage and google drive so as i can transfer files between them without downloading and uploading again
2 Replies
Hey @SBoustred - this is a really cool idea. Based on what I was reading online, there might not be a way around the download/upload step, but you may be able to achieve what you're looking to do using a couple different command line tools. I admittedly haven't tried these out, but you should be able to combine these into a single script that gets the job done.
I came across this Coderwall post, and they laid out the steps pretty well. It looks like they're using the gdrive command line utility to interact with Google Drive (the download step) and then uploading after-the-fact while still using the command line. Here's the link they provided for the gdrive GitHub: gdrive
Disclaimer: Per the GitHub README, the gdrive tool isn't being maintained anymore.
In the post, they're using the standard AWS command line tool to interact with an AWS bucket. That said, for the upload step, you could really use any Linode Object Storage-compatible tool you'd like (s3cmd, the Linode CLI, the Linode API, etc.).
To make it easier on yourself, you can always set your script up to download your Google Drive content to a temporary folder and then delete the content from your local system after it's uploaded to your bucket of choice.
Another option you could try: Mount an Object Storage bucket to a Linode running Ubuntu and then access your Google Drive directly from that Linode using the Google Drive API to pull the content. Again, I haven't tried this myself (and this guide is using an outdated version of Ubuntu), but it might be the most direct means of getting information from Google Drive to a bucket.
Here's our guide on accessing Google Drive with the Drive API on Ubuntu: Access Google Drive from Linode with Ubuntu 14.04
And here's a Community post on mounting a bucket to your Linode: Mounting an s3 bucket on your Linode
I hope this gives you a few things to play around with. If you find something that works, please share it here in case anyone else is looking to do the same. :)
Rclone all the way :)
It’s a small binary you install on a machine (doesn’t have to be a Linode although might help to be if there’s a lot of content.)
You would configure (rclone config) a connection to Google Drive, and one to Object Storage (using Rclone’s S3 profile.)
You can then run
rclone copy google:/folder os:/bucket
(Replace “google” and “os” with the names you give your Google and Object Storage profiles, and “folder” with the folder you want to sync, or remove entirely to sync all your Google Drive, and “bucket” with the name of the Object Storage bucket to save to.)
- I’ve never used Rclone with Google Drive so the syntax may be slightly different.
EDIT
I can’t see any way you could sync the two without downloading and uploading again - that would require a direct connection from
Google Drive to Object Storage, which I’m pretty sure doesn’t exist.