Installing grive on Debian for Google Drive Sync

Prerequesites:

apt-get install cmake gcc make build-essential libjson0-dev libcurl4-openssl-dev binutils binutils-dev libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-test-dev libboost-test libqt4-core libqt4-dev libqt4-dev-bin libqt4-gui qt4-dev-tools libgcrypt11 libgcrypt11-dev libyajl-dev yajl-tools libjson-c-dev libjson-c2 libjson0-dev git

 

Installation:

git clone git://github.com/Grive/grive.git
cd gdrive
mkdir build
cd build
cmake ../
make
mkdir grive/bgrive/doc
touch grive/bgrive/doc/grive.1
make install

The file /root/grive/bgrive/doc/grive.1 was missing in my case, so I've created a dummy file in order to finish the installation. I didn't figure out however why it was missing. As it's only the man page for grive, I considered it less important.

 

Starting Synchronisation:

The first time, you need to authorize grive to access your Google Drive, there fore do:
/usr/local/bin/grive -a
And follow the instructions (you will have to log into your account with a browser, confirm that you want to allow grive to access your drive and copy paste the given code to the terminal, pretty easy).

Then start the synchronisation for example like this: /usr/local/bin/grive -p /home/<user>/<google-drive-folder>

Command line options

Short option Long option Description
-h –help Produce help message
-v –version Display Grive version
-a –auth Request authorization token
-p arg –path arg Root directory to sync
-s arg –dir arg Single subdirectory to sync (remembered for next runs)
-V –verbose Verbose mode. Enable more messages than normal.
  –log-http arg Log all HTTP responses in this file for debugging.
  –new-rev Create new revisions in server for updated files.
-d –debug Enable debug level messages. Implies -v.
-l arg –log arg Set log output filename.
-f –force Force grive to always download a file from Google Drive instead of uploading it.
  –dry-run Only detect which files need to be uploaded/downloaded, without actually performing them.
  –ignore arg Perl RegExp to ignore files (matched against relative paths, remembered for next runs).