In this tutorial we will be making use of a small command-line program call “drive” that is written in Google’s “Go” programming language, by member of the Google Drive’s platform team to integrate Google Drive in Ubuntu.
First you need to understand how it works. It basically works similar to GitHub, i.e. you have to use “push” command to update files to your drive and “pull” command for retrieving any file from you drive. The developers who implemented this program, cited various reasons that background syncing is that beneficial as it seems, one simple reason being that it simply uses the bandwidth unnecessarily, even when the files are still up-to date, which is a little cumbersome if you have a slow-internet connection.
This however, might simply be the closest thing we have as of now, for integrating Google Drive on Ubuntu.
Installing Go Compiler
To use the command-line program we first need to install a compiler for Google’s Go Programming Language. Open the terminal by pressing Ctrl+Alt+T and type the following Command :
sudo apt-get install golang git mercurial
Press “Y” or “y” when prompted to
Also See: How to run exe files on Ubuntu
Installing Google Drive
After installing the Go compiler, type the following command to download and install Drive.
go get github.com/rakyll/drive
Now once the drive is installed you can use the following command to view the attributes for drive program
Setting up the Google Drive
To initialize the Google Drive for your account on your computer , type the following command
drive init <directory>
drive init /home/kashif/kashif_drive
You will be asked to authenticate your account.
Using the drive
You can use “drive push” command to push a file to the remote server.For e.g.
drive push xyz.txt
pushes the file “xyz.txt” stored at your current directory into our drive.
Alternatively , you can use “drive pull” command to retrieve files from you Google Drive account. For e.g. “drive pull xyz.txt” , downloads the file “xyz.txt” stored in your drive into your current directory. If you wish to download a file stored in a particular folder you can use “drive pull text/xyz.txt”, this downloads a file named “xyz.txt” from the folder name “text” stored on your Drive, into your current directory.
Thus, you have to manually make sync your files, as per your requirement.