Getting Google Drive on Ubuntu
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: [ “$ (pidof grive)” ]
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 [ “$ (pidof grive)” ] for Google Drive.