November 11, 2016 - rob

Installing google drive without having a x server

I have a few vps servers that I use, and I wanted to upload some backup files to one of my google drive’s.   While I have used google-drive-ocamlfuse on my workstation pc’s, it requires a web browers for the initial drive connection and also uses FUSE which I could not run on my vps servers.  I came across a app called gdrive which can upload files to google drive without the need for FUSE.   The installation is quite simple:

First head over to the page and download it:

I downloaded the 64 bit version using:

wget -O drive

Now move the file to /usr/sbin/

mv drive /usr/sbin/drive

And finally, make it executable:
chmod 755 /usr/sbin/drive

Now just run drive and you will get a link to put in any browser:

Go to the following link in your browser:

It will prompt you to login to your google account and allow access.  Once done, it will give you a code you paste back in your terminal:

Enter verification code: 4/9gKYAFAJ326XIP6JJHAEhs342t35LPiA5QGW0935GHWHy9

If you run drive with no options, the help page will appear:
Usage: drive [global options] <verb> [verb options]

Global options:
-a, –advanced Advanced Mode — lets you specify your own oauth client id and secret on setup
-c, –config Set application path where config and token is stored. Defaults to ~/.gdrive
-v, –version Print version
-h, –help Show this help

-i, –id File Id (*)
-i, –id File Id (*)
–format Download file in a specified format (needed for google docs)
-s, –stdout Write file content to stdout
–force Overwrite existing file
–pop Download latest file, and remove it from google drive
-t, –title Folder to create (*)
-p, –parent Parent Id of the folder
–share Share created folder
-i, –id File Id (*)
–bytes Show size in bytes
-m, –max Max results
–include-docs Include google docs in listing
-t, –title Title filter
-q, –query Query (see
-s, –shared Show shared status (Note: this will generate 1 http req per file)
-n, –noheader Do not show the header
–bytes Show size in bytes
–bytes Show size in bytes
-i, –id File Id (*)
-i, –id File Id (*)
-f, –file File or directory to upload (*)
-s, –stdin Use stdin as file content (*)
-t, –title Title to give uploaded file. Defaults to filename
-p, –parent Parent Id of the file
–share Share uploaded file
–mimetype The MIME type (default will try to figure it out)
–convert File will be converted to Google Docs format
-C, –chunksize Set chunk size in bytes. Minimum is 262144, default is 4194304. Recommended to be a power of two.
-i, –id File Id (*)
-p, –preview Generate preview url (default)
-d, –download Generate download url