gdrive is a command line utility for interacting with Google Drive.
- Enable https://console.cloud.google.com/marketplace/product/google/drive.googleapis.com
- https://console.cloud.google.com/apis/credentials and application type to be Desktop App give some name
- In "OAuth consent screen"; User type to External and publish
- Get the values for
clientId
andclientSecret
- For Go-preinstalled linux VM use: https://console.cloud.google.com/home/dashboard?cloudshell=true
or install
go version go1.19.1 linux/amd64
from https://go.dev/doc/install
git clone --depth=1 https://github.com/carstentrink/gdrive
cd gdrive
- Just edit the
clientId
andclientSecret
in the filehandlers_drive.go
. ./compile
- The binaries are located inside
gdrive/bin
folder ./gdrive_linux_amd64 about
./bin/gdrive_linux_amd64 about
Authentication needed
Go to the following url in your browser:
http://127.0.0.1:45137/authorize
Waiting for authentication response
- Open a browser at the URL
- For remote linux boxes just do the authentication locally and copy the
linux binary
and~/.config/gdrive/USERNAME_v2.json
to the remote box.