Backup to GDrive from CLI

Download file

$ wget https://github.com/odeke-em/drive/releases/download/v0.3.9/drive_linux
$ sudo mv drive_linux /usr/bin/gdrive
$ sudo chmod +x /usr/bin/gdrive

Login to Google Drive

$ gdrive init

Visit this URL to get an authorization code
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=x&redirect_uri=x&response_type=code&scope=x&state=x
Paste the authorization code:

Copy and paste authorization code from browser

Paste the authorization code: 4/2wEft2uIw864RlvoMR.........

Now let’s backup the files to Google Drive, it works as follows :

gdrive push -destination (path on google drive) (path on local drive)

ex :

gdrive push -destination GVM/motorexpertz motorexp_*