I use google drive a lot and I wanted to use my raspberry pi to automatically backup some of my more important files (i.e. documents and pictures) to google's cloud.
Now google hasn't released a google drive client for linux, as yet, but there is a really good open source linux client called grive which allows you to sync with google drive.
I got most of this info from, http://www.lbreda.com/grive/installation.
Use apt-get to install grive's dependencies, I already had some of these installed, but it hurt to re-run if your not sure.
Get the grive source code
Wait a while for it to compile (10-20 mins)
Setup your google drive folder and authenticate
You need to create a directory which grive will sync Google Drive with; anything in Google Drive will be synced into this folder and anything in this folder will be synced to Google Drive.
In order to make grive work it needs to be in your google drive copy the grive executable to the google drive directory, so copy it there:
Authenticate grive to work with your Google Drive account.
Grive will now give you a URL and ask you to provide an access code. Cut and paste the URL into a browser, if your not logged in to google, login, and it will present you with an access code, cut and paste this access code into grive.
NOTE - In order to run grive, you must be in the google drive directory, for some reason if you are not, grive doesn't work and moans about having to authenticate even if you have!
Grive can be run in a test mode, which will do everything other than uploading / downloading.
Once completed, your ~/googleDrive directory should now hold a copy of everything which is in your google drive. Also any files you put in your googleDrive directory will also get synced to google drive.
Backup other files and folders
I wanted to backup other files and folders and didn't want to put them in my ~/googleDrive folder so I did this by using symbolic links. Using symbolic links we can make it appear that a file over folder from a different location is in the google drive folder and as such will get synced to google drive. I used this technique to create a link to my Pictures folder which is stored on my NAS drive, that way all my pictures are backed up to google drive.
For more information on ln command.
Restricting bandwidth using trickle
One of the challenges I found in using backing up my files to google drive was a simple one of bandwidth, or more accurately a lack of bandwidth. When grive first ran, it uploaded a LOT of data to google drive and totally saturated by broadband (particularly as upload speeds are generally a lot less than download).
I came across a great utility called "trickle" which allows you to specify a maximum upload and download speed for any command, see http://www.tuxradar.com/content/control-your-bandwidth-trickle for more info.
Run grive using trickle
The following command will specify a maximum download (-d) and upload (-u) limit for grive of 50k.
I then chose to schedule grive to run once a week, using cron, thereby automating my file backup to google drive.