Unknown Unknown Author
Title: How to Mount Google Drive on Centos 6.2
Author: Unknown
Rating 5 of 5 Des:
Steps to Mount Google drive on Centos 6.2 Requirement: go 1.2 or higher is required. Download the Go distribution: Click on this l...

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: https://golang.org/dl/
and download this package https://golang.org/dl/go1.4.2.linux-386.tar.gz
Once downloaded then extract under /usr/local/ by running below command:
# tar -C /usr/local –xzf go1.4.2.linux-386.tar.gz

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 github.com/odeke-em/drive/cmd/drive
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 codehttps://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=354790962074-7rrlnuanmamgg1i4feed12dpuq871bvd.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive 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.


About Author

Advertisement

Post a Comment

 
Top