Dublicity on Google Drive [Experimental, it needs improvement]


So i since i’m not a linux sysadm, i’m trying to take an idea or a philosophy and do it on linux or the ee way. Feel free to add your suggestions or to destroy my idea completely.

You will need G Suite services.

The idea is to a full backup of my VPS in a external cloud environment. I want to avoid cost per snapsot per month and have everything under one interface like Google’s infrastructure.

I managed to send the backup to gdrive but it needs improvement since i 've no idea what the heck i’ve backed!

Help me to contribute a new tutorial about Duplicity + Google Drive. These are what i 've done so far…

  1. Installation of Duplicity Hence, tutorial Duplicity + Amazon S3 from ee team as a reference scenario.

  2. Credentials Allthough google’s console is a small university it’s smaller than AWS and quite easy when you 've done one API or two. I thought it must be a way to replace AWS’s settings with Google’s, well it does. Create your API Google Developer Console The goal is to make a new project! Tut Create an API token. There are many others tuts in youtube try there you 'll find something to suit your learning curve with API’s (it’s easy)

  3. Configure Dublicity In my mind i understand that it calls a file with credential values. What i did was to change the values of the export command for AWS within backup.sh file, with this.

export GOOGLE_DRIVE_SETTINGS=~/.duplicity/credentials duplicity --exclude-filelist ~/.duplicity/ignore ~/ gdocs://admin@admin.something/backup

Now we have to make that file. Create ~/.duplicity/.credentials.conf . I’ve made mine in under root folder, i don’t know if it’s a good idea, prob not. Now im thinking, we can add them where backup.sh is. Also to have them stored in a permanent location i don’t now if it’s agood idea at all.

The file should contain: client_config_backend: settings
client_id: <your client ID>.apps.googleusercontent.com client_secret: <your client secret> save_credentials: True save_credentials_backend: file save_credentials_file: gdrive.cache get_refresh_token: True

I think i had to run pip install pydrive. PyDrive is the library that lets Duplicity use OAuth to access Drive. You also have to chown and chmod the file for root user.

That’s it run bash /usr/local/sbin/backup.sh and it creates a link, copy and past iin a browser and google console will answer you a value, something like a pass, paste in your app in ssh and connection and backup is done.

As i said, feel free to add your suggestions or to destroy my idea completely as your contribution is crucial.

Sorry for the long way, if we manage, it can be only code and done! Spelling is an issue for me also, feel free to correct me!