Google released clients for its Drive for many platforms: Windows, MacOS, Android, iOS and so on. Unfortunately, an official Linux client is still a missing part of the puzzle. That is why developers worked to create unofficial clients for Google Drive.
Grive was a solution for many. It worked on Ubuntu, Debian and so on... It was distributed in source code only, so you had to compile it for your own OS. Unfortunately, things changed in April 2015. Grive no longer works. The reasons behind this issue are given here.
Is there an alternative to Grive? Yes, there are several options:
- Insync. This is a paid option. I leave it for those who interested.
- Ocamlfuse. It is a heavy-weight solution. I tried it in the past, and was not 100% happy about it.
- Jdrivesync. This is the free option I've never tried before.
I must warn you that Jdrivesync is in Beta status now (June 2015), so be careful with your data!
InstallationInstallation of Jdrivesync is very simple. All you need to do is to download the Java package from the Github page of developer and place it in the directory you're going to run the program from. It is written on Java, which means it is cross-platform and will work on any Linux distribution. Jdrivesync is distributed as a JAR package with a version number in the filename. In my case it is jdrivesync-0.2.1-jar-with-dependencies.jar.
Once downloaded, you need to check that the program actually works. Run a command
java -jar jdrivesync-0.2.1-jar-with-dependencies.jar
If you are lucky, you get an output with a program help page: list of available options and switches.
If you are not lucky, you may get an error that reads something like
Exception in thread "main" ...
Unsupported major.minor version 52.0...
Issue with a Java versionIf you see that Exception error, it is very likely your Java version is not high enough. Jdrivesync requires Java Runtime Environment (JRE) 1.8 or higher. Check this by running a command
If the result is
java version "1.8..."
then you're OK. If not, you will need to install Java 8.
- Debian 7 Wheezy comes with Java 6, which you can update to Java 7 via an official repository.
- Ubuntu 14.04 gives you Java 7 by default.
In both cases you need to update your Java version.
For other distributions, please check with your default Java installer or community.
It may take some time to download and install Java 8, since the package is about 160Mb in size.
Once installation is over, check your version once again.
Using JdrivesyncNow run the command
java -jar jdrivesync-0.2.1-jar-with-dependencies.jar -d -u -l "/local/directory/for/sync"
During the first run, Jdrivesync will prompt you to follow the link and get an authorisation code. Consecutive runs will simply synchronize your local folder with Google Drive account.
Parameters of Jdrivesync runThere are several parameters that I used in the sample above. Let's explain them.
-l "/local/directory/for/sync" specifies the local folder that should be used for data synchronisation. Please note that path should be given within a pair of quotation marks.
-u tells program to upload the changed files to the remote cloud server.
-d tells program to download the changed files from the remote cloud server.
Please bear in mind that order of the parameters should be "-d -u". Otherwise, system will do the opposite: delete new files on the remote cloud server, if there are no analogues on the local computer, and also delete new local files if there are no analogues on the remote cloud server.
And finally, you can add an option "--html-report" that will create a local file with a list of files and their status during the synchronization.
More parameters are listed in the program help section that you can get by running it with -h parameter or without any parameters at all.
Unfortunately, Jdrivesync does not have an option to monitor file changes on-the-fly. You will need to schedule synchronization yourself, for example with cron or Gnome Schedule programs. For me, I included this in the daily run of my backup routine.
Running Jdrivesync on several machines
I have several machines where I store copies of my cloud data. One of them is in active use. Another is a backup copy.
Unfortunately, there is an issue if you want to use Jdrivesync in this configuration. It works well in the one-system environment. However, the 2nd machine will not understand changes to the cloud storage if you use "-d -u" options there.
The workaround is to schedule not one, but two separate runs of Jdrivesync. One of them goes with "-d" and another with "-u" option. That isn't ideal, but still works.
I tried to find a contact of Jdrivesync's author to discuss this issue with him, but I could not find it. Maybe that is something in the plan for the future release?