Overview

This is a memo for using gdrive in a LAMP environment launched on Amazon Lightsail. This enables file backups to Google Drive, among other things.

Steps

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

You can access the server as shown below.

LTtiDpLbihhneeaineedbrstuiimtnxpevaiarxintlmioadtWDBoipgcuGeeoig@-rtaNdlctii1alUcunnp7md/boma:-2sifLymem1-siieniT72itlnath26nreuptaFu--cisxpoto25lblirM6-uuicitoua-2dtnochnmy50eimae:s-2do/eb:12nuslL204wseAhhh2.itrw__Mttt0:1te/il`,Pttt3~9hrsta_ppp:$.mhhwpsss20tsa.a:::5-hrAc/:1efeBk/19o/Saddc3-DrdOgoooceoLeccm2lbecUdssm0oia/T..u2uac*Ebbbn2dnh/Lyiii-cYtttfaGpoBnnyrmNrpNiaa.odUyOtmmbm6grniii4LriWa..t7iagAmccn2#nmhRiooa.1utRmmm2xa.A7/i1SrN.aa..MseT4wwc2PyY.ss1sd,2/m7Dte8i/.eest-n1bmco1f8ir4r6aaitanrbhseeet4dr.feu1rixc9entt.eeu2tnr3shte2oe/-fl1tawm(ap2r/0e2;2-03-07)x86_64

Installing golang

Install golang as follows.

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

You can verify the version as follows.

bgiotnvaemris@iiopn-1g7o21-.2161-.16-2l1i0n:u~x$/agmod6v4ersion

Installing gdrive

Run the following.

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

You can verify the version as follows.

bgGOidoStrl/niaAavnrmegci::h@:i2gp.ol-11i1..n711u21x-./26a6m-d16-4210:~$/go/bin/gdriveversion

Authentication

When you run the following, a URL is displayed.

bAGhEiuotnttttnhtpeaeosrmn:itt/v@ih/eicearpaci-tfcf1iooi7oluc2nlna-ott2nwsi6ei.o-engn1dgo-eoc2dugo1rld0lee:.:~ic$nomy/guoro/abbuirtnoh/w2gs/dearrui:tvhe?aacbcoeusts_type=offline&client_id=...

After pasting the obtained authentication code, the following is displayed.

UUFTMssroaeeetxrdea:::lu:pXXXlXXXoXXXadTBBsize:XXXTB

For example, running the following lists the files on Google Drive.

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

Summary

This summarizes the method for using gdrive in a LAMP environment launched on Amazon Lightsail.

You can check gdrive usage at the link below. I hope this is helpful for use cases such as file backups.

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