duplicity with Google drive not saving cache file

449 views Asked by At

gdrive cache file never saves. It always ask to authenticate I also can't seem to find it anywhere else. I run the script from the directory that contains the bash script.

Can you see anything that is wrong or what might be cause the cache file not to save.

I am using duplicity 0.7.10.

Here is the script

#!/bin/bash
SCR_BACKUP="/home/XXX/Documents"
CURDIR="/home/XXX/.duplicity"
GPGKEY="XXXXX"
DEST_BACKUP="gdocs://<email>@gmail.com/$HOSTNAME-backup"

cd $CURDIR

BACKUPCMD="duplicity incr -v 9 --encrypt-key $GPGKEY --full-if-older-than 4M --volsize 1024 --asynchronous-upload --exclude-device-files --exclude-other-filesystems ${SCR_BACKUP} ${DEST_BACKUP}"

GOOGLE_DRIVE_SETTINGS=gdrive $BACKUPCMD

Here is pydrive config file

client_config_backend: settings
client_config:
  client_id:XXXXXX.apps.googleusercontent.com
  client_secret: XXXXXX
save_credentials: True
save_credentials_backend: file
save_credentials_file: gdrive.cache

get_refresh_token: True
2

There are 2 answers

0
Don'tKnow2 On

I got the cache file to be created by backing up the location in the current directory. Eg. I make the variable SCR_BACKUP=$CURDIR

This created the gdrive.cache and then I changed the variable back to the location I wanted to backup.

0
Uffe On

For me, the solution was to mimic as close as possible the example in the PyDrive documentation (see this link):

client_config_backend: settings client_config:
  client_id: 9637341109347.apps.googleusercontent.com 
  client_secret: psDskOoWr1P602PXRTHi 

save_credentials: True 
save_credentials_backend: file 
save_credentials_file: credentials.json 

get_refresh_token: True