Raspberry Pi – Synchronize Raspberry Pi with your Google Drive
If like me you have a Google Drive, you have surely a customer to your timing is on Mac, Windows or Linux. There is no reason that the Raspberry cannot do : Thank you Grive !
Grive allows to synchronize your Google Drive with a local directory. Synchronization in both directions.
There is no package for powerpcspe so it'll have to do all the steps to compile this tool.
- Install packages needed for compiling
apt - get install git cmake build-essential libgcrypt11-dev libjson0-dev libcurl4-openssl-dev libexpat1-dev libboost-filesystem-dev libboost-program-options-dev binutils-dev qt4-dev-tools libyajl-dev libboost-all-dev
- Retrieve the sources of Grive
git clone git://github.com/Grive/grive.git
- Prepare the compilation of Grive
cd grive cmake .
- To make the compilation should change the file libgrive/src/drive/State.cc. Replace (lines 251 and 252 Home)
last_sync.Add( "SEC", JSON(m_last_sync.SEC() ) ); last_sync.Add( "NSEC", JSON(m_last_sync.NanoSec() ) );
last_sync.Add( "SEC", JSON((boost::uint64_t)m_last_sync.SEC() ) ); last_sync.Add( "NSEC", JSON((boost::uint64_t)m_last_sync.NanoSec() ) );
and the following line (256 Home)
result.Add( "change_stamp", JSON(m_cstamp) ) ;
result.Add( "change_stamp", JSON((boost::uint64_t)m_cstamp) ) ;
- Compile Grive
- Now you have the executable in a sub directory Grive. The program synchronizes the drive in the directory where it is located. Therefore, move it there where you will put your files
cp grive/grive /path/vers/le/repertoire/google
- When the first execution :
cd /path/vers/le/repertoire/google ./grive -a
- The tool will display a URL. Copy and paste into a browser to give your permission to Grive :
- You get a code to copy/paste in the terminal where runs Grive :
- Here's what you should get (with a Google Drive blank in my case) :
- For the next time you want to synchronize, do not use the-a parameter and run just the thrush from the directory where you sync :
cd /path/vers/le/repertoire/google ./grive
You now have your files on your Raspberry Pi.