Return to site

How To Install Google Drive On Linux

broken image


G oogle Drive is great for storing your data in the cloud, so that your data is synced across several devices for instant access. Unfortunately, Linux Mint 18.1 and even the latest 18.2 doesn't come installed with GNOME Online accounts. Therefore, you can't add Google accounts by default settings. Another solid choice is a program called Drive. Drive is a terminal push and pull drive client and is designed by a Google engineer. Drive is not designed to sync all of your files, but is more like an on demand push and pull software used mainly for storage purposes. The process of installing this program to your Linux desktop is the following: 1.

How to Install Google Drive in Linux Mint / Ubuntu. Google has announced its file storage and synchronization service called Drive but there's still no official Linux client. There are some unofficial clients, but they're not perfect: Insync is not free, Grive is command line only and its development seems to have stopped and so on.

So here's another alternative for easily managing your Google Drive files under Linux: google-drive-ocamlfuse. google-drive-ocamlfuse is a FUSE filesystem backend for Google Drive which you can use to mount your Google Drive under Linux.

Among its features are full read/write support for regular files and folders, multiple account support, duplicate file handling as well as access to the Google Drive trash directory. google-drive-ocamlfuse also provides read-only access to Google Docs, Sheets and Slides, which its converts to ODT, ODS of PDF (this can be configured).

google-drive-ocamlfuse is still under testing so while it works pretty well, you may encounter bugs. For instance, in my test, some Google documents weren't converted for some reason.

It's also worth mentioning that the changes don't show up instantly – when you edit or upload a new file, it can take 60 seconds (this is configurable) until the changes show up in the mounted filesystem. If newly added files don't show up in your file manager, enter the folder again or refresh it (Ctrl + F).

Install google-drive-ocamlfuse in Linux Mint /Ubuntu

Google-drive-ocamlfuse is now available in a PPA. Add the PPA and install it in Linux Mint / Ubuntu using the following commands:

sudo add-apt-repository ppa:alessandro-strada/ppasudo apt-get updatesudo apt-get install google-drive-ocamlfuse

How to Use it ?

Firstly, you need to authorize google-drive-ocamlfuse with Google. To do this, run the following command:

google-drive-ocamlfuse

This should open a tab in your default web browser, asking to allow google-drive-ocamlfuse to access your Google Drive. Click 'Allow', wait a few seconds for google-drive-ocamlfuse to retrieve the authorization code and you're done.

Now let's mount Google Drive. Create a folder in your home directory, let's call it 'gdrive':

mkdir ~/gdrive

And mount Goole Drive using the command : google-drive-ocamlfuse ~/gdrive

That's it. If you want to configure the interval between queries to detect server-side changes, the export format used for Google documents and so on, see the configuration file: ~/.gdfuse/default/config

Create A Start Up Program

To mount Google Drive on startup, add 'google-drive-ocamlfuse /path/to/gdrive' (replace the '/path/to/ with the exact path to the folder where you want to mount Google Drive) to Startup Applications. For more info, including using multiple accounts, see the google-drive-ocamlfuse wiki.

Uploading or Downloading a file – Google Drive Linux Client using GDrive

Maybe something people can use as additional storage space?? GDrive is a Google Drive Linux Client that no Unix Administrator or user can do without.

Whilst browsing around the net a few weeks ago I came across a tool that just grabbed my attention. On the face of it I wasnt sure how useful this would be, but I showed it to one of my clients just in case he found some business function where he could use it.

Anyway last week he came back to me as he wanted to share a file with multiple people so this tool seemed ideal to be able to do it.

Introduction to GDrive

Firstly this tool can be used across multiple flavours of Linux (I use Centos 6 normally), as well as raspberry pi, windows (not sure of the practical use for this…), and even Apple Mac.

Installing GDrive – Google Drive Linux Client

Simply download the latest version from their github page HERE

For my Centos 6 server I used this one : drive-linux-x64 v1.9.0

(right click and copy link url then paste into wget below)

wget -O /usr/local/bin/gdrive 'paste url here'

I copied the file into /usr/local/bin so it is globally available to all users on my server, and I also renamed it to gdrive juat as I thought that would be easier to remember !! Dont forget to make the file executable (chmod +x /usr/local/bin/gdrive) and thats it !!!

Configuring GDrive using your Google Drive Linux Client

How to update logic pro x 10 4 7. When you first run any gdrive command it will prompt you to link it to your google drive account and give it permissions. How to set adobe as default. Easiest way to do this is just to try and list the files on your Google Drive like this :

gdrive list

The program will then return with a url you need to link it to your account. Here is how I did it :

1) Open Chrome (or any browser) and log in to the Google account you want to link gdrive with
2) Make sure you can see in your apps Google Drive appearing (the menu in the top right is normally where it appears
3) Paste in the url from the output of the ‘gdrive list' you did earlier, and accept the permissions prompt it needs to enable gdrive to upload and download files.

Once you have done all that then go back to your command line session and run the ‘gdrive list' again. You should see a list of your files on Google Drive !!

First proper test of GDrive – Uploading a file – Google Drive Linux Client

Once again a very simple process. As example just copy your /etc/hosts file to Google Drive like this :

gdrive upload -f /etc/hosts

How damn simple is that !!!

Run your ‘gdrive list' again to see your file there. You can also see it in your browser if you are still logged in Google Drive (or log back in just to check then you know it all works!)

Downloading a file from Google Drive Linux Client with GDrive

How To Install Google Drive On Linux Mint Locally

How to install google drive on linux mint

Ok so you may have noticed when you did ‘gdrive list' in the previous steps that each file has an ID? Do it again and you will see :

# gdrive list
Id Title Size Created
0B0tRrdcY7CwJZHh5ZmVpZHRMYW8 drive-linux-amd64 10 MB 2014-09-25 17:47:08
0B0tRrdcY7CwJY2lNS2x3NC1lQUU drive-linux-386 8 MB 2014-09-25 17:47:01
0B0tRrdcY7CwJR3lmZnlRaFZwOHc drive-linux-arm 9 MB 2014-09-25 17:46:57
0B0tRrdcY7CwJQlRfQUVxY2hkWUE drive-linux-rpi 9 MB 2014-09-25 17:46:52

So to download a file it is the ID you use and not the filename. Therefore just as simple this is how you download a file :

gdrive download -i 0B0tRrdcY7CwJZHh5ZmVpZHRMYW8

And thats it !! Are you falling in love with this program as much as I did?? (dont worry, I have got over it now…)

Sharing a file you have uploaded to Google Drive Linux using GDrive on the command line

The one part of this program that maybe could be improved in the future…. sure you can share a file, the only limitation at the moment is you can only share to EVERYONE, and not to specific people/emails.

Anyway here is how you do it. Same as the download option you need the file ID which you can get from the ‘gdrive list' method :

gdrive share -i 0B0tRrdcY7CwJZHh5ZmVpZHRMYW8

Other functionality in GDrive – Google Drive Linux Client

There is a few other options in GDrive that are pretty cool ive listed below :

– Delete a file from Google Drive
– Create a folder on your Google Drive (this folder can also be shared to everyone)
– Upload a file into a folder on Google Drive (using a parent ID of the folder) How to install world edit 1 5 2.

Not bad at all for a freebie !!!

Any comments or questions let me know, dont forget to share this post to others who may find it useful, and please check out my other Linux and Bash tips HERE and HERE

Related Posts

Install Gdrive On Linux

  • How to easily disable a wordpress plugin (2)
  • How to test if lftp has worked in bash script (2)
  • How to convert a wav to mp3 using ffmpeg (2)
  • Linux Date Problem – 1 month ago date bug (2)
  • Bash remove duplicate lines without sorting (2)
  • Upgrade Plex Media Server (Centos, Ubuntu, Fedora) (2)
  • How to stop people trying to hack your root logon (2)
  • Install and configure Varnish 4 – Varnish Cache for WordPress (2)
  • Nagios Systems Monitoring Application Review (2)
  • How to Install MariaDB on Centos 6 (2)




broken image