So, when Google released Drive, I was so excited. It was half the cost of Dropbox with double the space. Awesome. But, no full support for Linux. Well crap. Because of that, I'm still holding on to Dropbox for now for the items I sync most frequently. However, there are files that I do not update as frequent and thus am using Google Drive to store them. So, whats a Linux user to do?
Grive comes to the rescue. Grive is an open source Linux client for Google Drive. It work perfectly for me. The only problem is that it does not keep files synced automatically (ie it doesn't run in the background) so you have to run the application manually in order for the files to sync. That's where I've created a little script that runs every 2 minutes via a cron job to do it for me.
Of course, you'll need to make sure you have Grive installed and configured. Use this tutorial on how to do that: http://www.webupd8.org/2012/05/grive-open-source-google-drive-client.html
Now, we'll create the script to handle an automatic sync for us.
sudo pico /usr/local/bin/syncgrive.sh
Add the following contents then ctrl O then enter to save
if [ "$(pidof grive)" ]
echo "Grive is already running."
Change /home/myuser/Drive to the Drive folder you configured.
Now edit your cronjobs:
Then add the job (ctrl O then enter to save):
*/2 * * * * /usr/local/bin/syncgrive > /dev/null 2>&1
That will run every 2 minutes. Adjust to your preferences.
There ya go! An automatic sync for Google Drive.