I'm trying to use duplicity to backup my files from my Linux desktop.
I read the answer to this question How do I backup to google drive using duplicity? dating from 2015 but it might be obsolete ?
From the duplicity documentation, https://duplicity.gitlab.io/stable/duplicity.1.html, I understand I have to :
- Go to https://console.developers.google.com and create a projet, which I did. Name: mybackup-12345 (I changed the name for this question)
- create an oauth access, and get the secret in a json file. My json file content is as follow (/home/myuser/backups/google_client_secret_json_file.json):
{
"installed":{
"client_id":"XXXXXXXX.apps.googleusercontent.com",
"project_id":"mybackup-12345","auth_uri":"https://accounts.google.com/o/oauth2/auth",
"token_uri":"https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
"client_secret":"XXXXXXX",
"redirect_uris":["http://localhost"]
}
}
export GOOGLE_SERVICE_JSON_FILE=/home/myuser/backups/google_client_secret_json_file.json
export GOOGLE_CREDENTIALS_FILE=/home/myuser/backups/google_credentials_file
(this file does not exist yet, I supposed that duplicity would create it after the first login)export GOOGLE_SERVICE_ACCOUNT_URL="mybackup-12345@mybackup-12345.iam.gserviceaccount.com"
- And finally launch duplicity:
duplicity /home/myuser/Documents gdrive://${GOOGLE_SERVICE_ACCOUNT_URL}/backups/documents?myDriveFolderID=root
I tried other values before, but I guess this should not be far from what I should do. But I get this (python) error now :
google.auth.exceptions.MalformedError: Service account info was not in the expected format, missing fields client_email, token_uri.