It was tested on duplicity 0.7.06.
To install copy gdrivebackend.py to duplicity's backends directory.
/usr/lib/python2.7/dist-packages/duplicity/backends/
It requires google-api-python-client: https://github.com/google/google-api-python-client
To install execute:
pip install --upgrade google-api-python-client
or:
easy_install --upgrade google-api-python-client
At google developer console: https://console.developers.google.com
- Create a project.
- Enable Drive API for it.
- Create a Service Account or Installed App credential.
- Create a Installed App credential at google developer console.
- Get client id and client secret key.
export GDRIVE_APP_TOKEN_FILE='path_to_save_token_file.key'
export GDRIVE_APP_SECRET='client_secret_key'
gdrive://installed_app_client_id/path
- Run duplicity to get authorization url.
export GDRIVE_APP_CODE='response_code'
- Run duplicity to generate the token file.
Now GDRIVE_APP_CODE isn't needed any more and can be removed.
Note that Service Account has it's own drive, it won't upload to your drive.
- Create a Service Account credential at google developer console.
- Get service account email address.
- Generate a .json key file.
export GDRIVE_SERVICE_KEY_FILE='path_to_key_file.p12'
gdrive://service_account_email/path