Overview

Memorandum for using gdrive in a LAMP environment started with Amazon Lightsail, allowing backup of files to Google Drive, etc.

Procedure

First, access Amazon Lightsail and press the following “Connect using SSH” button on the target instance.

You can access the server as follows.

LTTTTDLbihhhheaineeeebstuitnxppppaarrrrnlmiooooWDhBoipggggGeotig@-rrrrNlcttii1aaaaUcupnnp7mmmm/omsa:-2ssssLme:m1-ien/iT72iiiint/h26nnnnutadFu--ccccxotoo25llll\icrM6-uuuuc}tosua-2ddddo/hn.my50eeeeme:bs-2ddddei:12sLht204wwwwAtnh2.iiiiw_Mtat0:1tttti,Ppmt3~9hhhht\_sip:$.h}|p:.s20tttt/_ac:5-hhhhA|c/o/:1eeeeB__kdm19S`|aoc3-DDDDO_gcaoceeeeLeswm2lbbbbUd.sm0oiiiiTb/u2uaaaaEbin2dnnnnL\yti-Y}ntfaGGGGBayrmNNNNNim.odUUUUOtibm6////n.i4LLLLWact7iiiiAmon2#nnnnRima.1uuuuR/m2xxxxA7ai1SN.w..MssssT4sc2PyyyyY./o1ssss,2im7Dtttt8n/.eeeeet-f1bmmmmo1r8i4a6aaaaatsnrrrrhteeeeer4u.ffffec1rrrrxt9eeeetu.eeeeer2ne3sssst/2ooool-ffffpa1ttttemwwwwrp(aaaam/2rrrri0eeeet2;;;;t2e-tttd0hhh3eeeb-y0eee7xxxa)aaapcccpxtttl8i6dddc_iiia6sssb4tttlrrreiiibbbluuuatttwiii.ooonnnttteeerrrmmmsssfffooorrreeeaaaccchhhppprrrooogggrrraaammmaaarrreeedddeeessscccrrriiibbbeeedddiiinnnttthhheee/iunsdri/vsihdaurael/dfoicl/e*s/cionpy/ruisgrh/ts.hare/doc/*/copyright.

Install golang

Install golang as follows.

bitnami@ip-172-26-1-210:~$sudoapt-getinstallgolang

You can check the version as follows.

bitnami@ip-172-26-1-210:~$ go version
go version go1.11.6 linux/amd64

Install gdrive

Execute the following.

bitnami@ip-172-26-1-210:~$gogetgithub.com/prasmussen/gdrive

You can check the version as follows.

bitnami@ip-172-26-1-210:~$ . /go/bin/gdrive version
gdrive: 2.1.1
Golang: go1.11.6
OS/Arch: linux/amd64

Authentication

Run the following to get the URL.

bitnami@ip-172-26-1-210:~$ . /go/bin/gdrive about
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=...

Enter verification code:

Paste the verification code you got and you should see something like this

UUFTMssroaeeetxrdea:::lu:pXXXlXXXoXXXadTBBsize:XXXTB

For example, the following will list the files on Google Drive.

bitnami@ip-172-26-1-210:~$./go/bin/gdrivelist

Summary

This is a summary of how to use gdrive in a LAMP environment started with Amazon Lightsail.

The usage of gdrive can be found below. We hope you find it useful, for example, for backing up your files.

https://github.com/prasmussen/gdrive#usage