Ubuntu / Linux news and application reviews.

Grive was an unofficial, open source command line Linux client for Google Drive. I say "was" because the tool no longer works due to Google changing it's API recently and Grive not being maintained any more (there are no commits on its GitHub page since May, 2013).


To get Grive up and running again, Vitaliy Filippov forked it and named his fork "Grive2". The fork supports the new Google Drive REST API and it also includes a new feature: partial (directory) sync, along with bug fixes.

Compared to the original "Grive", Grive2 comes with the following changes:
  • supports the new Drive REST API
  • added partial sync
  • major code refractoring: a lot of dead code removed, JSON-C is not used any more, API-specific code is split from non-API-specific
  • some stability fixes
  • slightly reduce number of syscalls when reading local files
  • bug fixes

Also, just like the old app, Grive2 does NOT support:
  • continuously waiting for changes in file system or in Google Drive to occur and upload. A sync is only performed when you run Grive, and it calculates checksums for all files every time;
  • symbolic links;
  • Google documents.

Install Grive2 in Ubuntu or Linux Mint via PPA

Since there are quite a tools that rely on Grive, the Grive2 binary and package continue to be called "grive", so installing Grive2 from the main WebUpd8 PPA will overwrite any old Grive versions it may find on the system (just as if it was a newer Grive1 version).

To install Grive2 in Ubuntu, Linux Mint and derivatives by using the main WebUpd8 PPA, use the following commands:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install grive
If you don't want to add the PPA, you can download the deb from HERE (for Ubuntu 12.04, you'll also need yajl2 - get it from HERE) but installing the debs manually means you won't receive automatic updates.

Arch Linux users can install Grive2 via AUR (it's actually the old "grive" package, updated with the new Grive2 fork).

For other Linux distributions, see the Grive2 GitHub page.

Using Grive2


1. Grive2 will download / upload new or changed files from the directory you run it. So firstly, let's create a new folder - we'll call it "grive" -, in your home directory:
mkdir -p ~/grive

2. Next, navigate using the terminal into the newly created "grive" folder:
cd ~/grive

3. The first time you run Grive2, you must use the "-a" argument to grant it permission to access your Google Drive:
grive -a
After running the command above, an URL should be displayed in the terminal - copy this URL and paste it in a web browser. In the newly loaded page, you'll be asked to give Grive permission to access your Google Drive and after clicking "Allow access", an authentication code will be displayed - copy this code and paste it in the terminal where you ran Grive2.

That's it. Now each time you want to sync Google Drive with your local "grive" folder, navigate to the "grive" folder (step 2) and run "grive" (this time without "-a" since you've already authenticated Grive with Google Drive).

Grive2 comes with some advanced features as well. For instance, compared to the original Grive, the new Grive2 fork supports partial sync. To only synchronize one subfolder (a folder from your ~/grive directory) with Google Drive, use:
grive -s SUBFOLDER
(replacing "SUBFOLDER" with the name of the subfolder you want to sync)

To see all the available options, type:
grive --help