Installation

Pre-packaged versions are available for some distributions.

The following instructions for compiling from the very latest “master branch” source and running grive in Linux Mint 13, which is based on Ubuntu 12.

I don't claim these are “correct” instructions – I haven't been a developer since 20 years ago. But I could not find good instructions anywhere, and it took me a while to figure this out. They worked for me, and I'm writing this hoping to save someone else the time. By all means, if you can make these instructions better, please do. The more people we get using this, the faster we can find bugs!

There are some folks out there doing the favor of building debian packages, which makes it even easier than the steps below, but these are not always kept up to date. Since this application is in such fast development (thank you!), here are the instructions to easily compile from the latest sources. Most of you already know how to do this via pure command line, so I'll just give (mostly) GUI based instructions for non dev types.

1. Dependencies

Open Software Manager and install the following packages:

  • git
  • cmake
  • build-essential
  • libgcrypt11-dev
  • libjson0-dev
  • libcurl4-openssl-dev
  • libexpat1-dev
  • libboost-filesystem-dev
  • libboost-program-options-dev
  • libboost-all-dev
  • automake
  • autoconf
  • libtool
  • pkg-config
  • libcurl4-openssl-dev
  • intltool
  • libxml2-dev
  • libgtk2.0-dev
  • libnotify-dev
  • libglib2.0-dev
  • libevent-dev
  • checkinstall

Or, on a Debian (or Debian derivate) disribution, open a terminal window and type:

sudo apt-get install git cmake libgcrypt11-dev libjson0-dev libcurl4-openssl-dev libexpat1-dev libboost-filesystem-dev libboost-program-options-dev libboost-all-dev build-essential automake autoconf libtool pkg-config libcurl4-openssl-dev intltool libxml2-dev libgtk2.0-dev libnotify-dev libglib2.0-dev libevent-dev checkinstall

Then install yajl:

git clone git://github.com/lloyd/yajl yajl
cd yajl
./configure
cmake .
make
sudo checkinstall

2. Download

If this is the first time you are doing this, use git to get the source code into a directory of your choice.

git clone git://github.com/Grive/grive.git

The source code will be in a subdirectory called “grive”. “cd” to that directory and then jump to step 4, to run “cmake”.

cd ./grive

3. Updates

For subsequent updates, you'll “pull master” to get the latest source. “cd” to the subdirectory you used in the prior step, and cd to the grive subdirectory:

cd /path/to/yourGriveSourceCodeDir
cd ./grive
git pull origin master

  • Check out this git book for more info about git.
  • Note that there can be a delay in updating the tarball (tar.gz button on upper right) at http://grive.github.com/grive/, and it may not have the very latest. Pulling from git ensures the very latest.

4. CMake

Now that you are in the source code's “grive” subdirectory, at the prompt type:

cmake .

  • note the period (.) as the argument to cmake, to denote the current directory.
  • You should get a success message like: ”– Build files have been written to: /your/dir”
  • Note I did not use “sudo cmake .” – you don't necessarily need to build it as root.

5. Make

At the prompt type:

make

  • You'll get lots of messages & hopefully a success message: ”[100%] Built target grive_executable”
  • The executable file itself (called “grive”) will be placed in the “grive” subdirectory.

6. Copying the executable

I don't know whether it's possible not to, but for now the only way I know is to run the grive executable from your Google Drive directory.

You probably won't want to run grive from the directory it compiled in. The entire grive source tree in that directory would be uploaded to your google drive, and your google drive would be downloaded to your grive source directory.

So copy the grive executable file to the top level of your google drive directory.

cp ./grive/grive /home/you/yourGoogleDrive/

  • As a side effect, that file will be uploaded (“sync'ed”) by grive to your Google Drive top-level directory.
  • Note the executable file “grive” is in yet another subdirectory also called “grive”.
  • There is one terrific advantage – you can copy the grive executable to different directories, sync'ed with different Google Drive accounts, and it should all work.

7. Backup

Since, grive is alpha software, you DEFINITELY want to keep a backup copy of your google directory.

I'm keeping two copies of the directory to compare manually to see what grive does.

8. First run

Change to your google drive directory, and run grive:

cd /home/you/yourGoogleDrive/
./grive -a

  • The ”-a” option is only needed the very first time you run grive.
  • Visit the URL that comes up, then post the auth code given (you must have been logged into Google). You should get some messages including “Synchronizing files” … now you are running.

9. Syncs

To sync, you must run the program manually (there is no “real-time watching” yet). At the prompt, type:

./grive

You can set up a cron job, if you want this done on a regular basis.

If you get a “crash” (bunch of error messages on the screen), you should run:

./grive -l log.txt

to create a file you can send to Nestal.

As the file will contain a log of the sync operation, you may want to edit the file first to remove personally sensitive information.

10. Checking the differences

I like to see the differences with my backup copy of my google drive, to see what grive did.

I'm using jFileSync. It's has a nice GUI, but it's old (last build 2007). It runs great, but I think the java libraries it references don't run 100% with the latest libraries. For example, I can't resize the columns. But the core compare/copy functionality is working fine.

I would appreciate it if someone could point me to a more modern program.

You can also use the diff command with directories. At the command line:

diff -r dir1 dir2

  • That “works” as it gives you text output of what's different, but the nice GUI of jFileSync allows you to also easily fix any differences.
  • Also, jFileSync is very fast because it just compares timestamps, not byte-by-byte. That has some obvious risks. “diff -r” does a recursive text or binary compare depending on the file. Binary files are compared byte-by-byte so it's very slow, but safe.

Keep up with posts at https://plus.google.com/116411649000013553715/posts andhttps://github.com/grive/grive/issues for the latest info, especially news as to newly discovered bugs and when you need to download and build again!