Grive an open source Linux client for Google Drive. Installing it on sabayon is fairly easy. The steps I did from terminal in my home directory:
Setup and Install
mkdir gdrive
mkdir git
cd git
git clone https://github.com/Grive/grive.git
cd grive
Make sure cmake is installed, if not
equo install dev-util/cmake
cmake .
make
cp ./grive/grive /home/wolfden/gdrive/
cd /home/wolfden/gdrive/
The first run you need to authorize it with your google account so:
./grive -a
Now follow the directions in the prompt and than it should sync your account. Simple as that and than in future all you need to run is:
./grive
Update Grive
In the future to update the program you will need to use git to pull changes, so from home directory:
cd git
git pull origin master
Than do steps again as you did above, but skipping the grive -a step as you are already authorized.
Cron Job
Add yourself to the cron group, so for myself as root:
gpasswd -a wolfden cron
Than you will need to log out and log back in to continue. Now to set the job:
crontab -e
Add the line below and save it (edit parameters and path of course) this syncs every 30 minutes with your gdrive account so adjust to your needs:
*/30 * * * * cd /home/wolfden/gdrive && ./grive
Use the command below to see cron jobs
crontab -l
If you have problems with cron, you will have to check /var/log/messages can monitor with:
tail -f /var/log/messages
Remember you can always run ./grive manually if you need to sync immediately:
cd /home/wolfden/gdrive && ./grive
Alias
You can also set up an alias to make a bit easier. Edit the .bashrc file in your home directory and add a line like:
alias gdrive-sync='cd /home/wolfden/gdrive && ./grive'
Than all you need to do is issue the command gdrive-sync and it will do the sync
Script
You can set up inotify with grive
equo install sys-fs/inotify-tools
Copy and paste the code below into a file called grive.sh (don't forget to chmod +x grive.sh) Change the info in the script so paths match to your install. The problem with this script is it don't see changes on the server. It only watches for changes on the local system and when a change happens, it syncs with your gdrive. You can add the script to your startup session so it runs all the time. Just remember it only syncs if you make changes locally. You still need to sync first if you made changes on server.
#!/bin/bash
# Google Drive Grive script that syncs your Google Drive folder on
#change This functionality is currently missing in Grive and there are still
#no official Google Drive app for Linux comming from Google.
#
# This script will only detect local changes and trigger a sync. Remote
# changes will go undetected and are probably still best sync on a
#periodic basis via cron.
#
# Kudos to Nestal Wan for writing the excellent Grive software
# Also thanks to Google for lending some free disk space to me
#
# Peter Österberg, 2012
#
#GRIVE_COMMAND_WITH_PATH=~
GDRIVE_PATH=~/gdrive
#
while true
do
inotifywait -e modify -e move -e create -e delete -r $GDRIVE_PATH
cd /home/wolfden/gdrive && ./grive
done