Since there is no linux version of the Google Drive software, I took my time today to look around for a (halfway) decent solution and found grive. Grive is easy to install and to use, but it does not synchronize your local folder and your Google Drive automatically.

In Ubuntu, installing grive is as easy as this:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install grive

Afterwards, one has to set it up. First we create a folder for the Google Drive data

mkdir GoogleDrive

and we change into that directory

cd GoogleDrive

now we setup grive

grive -a

The software will ask you to open a link in your browser where you have to allow access to your Google Drive. You copy and paste an authentification code and your done. Grive starts synchronizing your local folder to Google Drive for the first time. Afterwards, when ever you type

grive

within your google folder, synchronization will take place. But you have to invoke the command manually.

This is where the inotify-tools come into play. The inotify-tools allow you to monitor a specific folder for changes. This is just what we need. After installing them via

sudo apt-get install inotify-tools

we will write a little script that will monitor our local Google Drive folder and that will invoke grive whenever we make changes.

#!/bin/bash
while inotifywait -e modify,create,move,delete /[path-to-your-local-google-folder]
do
cd [path-to-your-local-google-folder]
grive
done

We just save the script above in a text file named „monitorAndSynchronize.sh“ (or what ever you like), make it executable

chmod a+x monitorAndSynchronize.sh

and make sure it is started when ever we boot up or log-in.

This is of coure only half the way to a fully functional Google Drive (because it does not synchronize when changes are made on the server), but i’m afraid it’s as good as it gets for now.

Sources:
GRIVE: OPEN SOURCE GOOGLE DRIVE CLIENT FOR LINUX
linux | Verzeichnisse auf Änderungen Überwachen