How to Mount Google Drive on Centos 6.2

How to Mount Google Drive on Centos 6.2

by -
0 2627

Steps to Mount Google drive on Centos 6.2

Requirement: go 1.2 or higher is required.
Download the Go distribution:
Click on this link:
and download this package

Once downloaded then extract under /usr/local/ by running below command:
# tar -C /usr/local –xzf go1.4.2.linux-386.tar.gz

Auto Mounting Google Drive

Install Required RPM's

Install required rpm with the help of yum command:
# yum install git mercurial glibc perl-Error perl-Git nss-softokn-freebl

Now, add “/usr/local/go/bin” to the PATH environment variable. You can do this by adding this line to your /etc/profile (for a system-wide installation) or $HOME/.profile:
# vi /etc/profile
export PATH=$PATH:/usr/local/go/bin
export GOPATH=/usr/local/go/

Use source command to load changes:
# source /etc/profile

Installation of Drive Package:

To install from the latest source, run:
$ go get -u
This will download binary under /usr/local/go/bin/.

Once drive is installed on system, before you can use drive, you need to mount your Google Drive directory on your local file system for this make “gdrive” directory and then run “drive init ~/gdrive” command:
$ mkdir gdrive
$ drive init ~/gdrive Visit this URL to get an authorization code Paste the authorization code:
Visit the above URL to get the code and paste the code to get access to Google drive on local system.

Now, run the below command to list the contents of your drive.
# cd /gdrive
# ls –l

Pull and Push Google Drive Content:

The “pull” command downloads data from Google Drive that does not exist locally, and deletes local data that is not present on Google Drive. Run it without any arguments to pull all of the files from the current path:

# cd /gdrive

# drive  pull

The “push” command uploads data to Google Drive to mirror data stored locally.

Like pull, you can run it without any arguments to push all of the files from the current path, or you can pass in one or more paths to push specific files or directories.

Note: To ignore checksum verification during a push use:

$ drive push -ignore-checksum

Add entry in crontab for push and pull to make things automatically instead of manually

Make an entry in crontab file:

# crontab –e

*/1         *             *             *             *             /usr/local/go/bin/drive push   ~/backup

*/1         *             *             *             *             /usr/local/go/bin/drive pull   ~/backup

This will pull and push contents every minute.

Check cron logs:

# tail   –f   /var/log/cron

If user changed the Google drive password even then at linux pc no need to do any changes while uploading and downloading contents.

Download PDF


Leave a Reply

Required Captcha *