简体   繁体   中英

duplicity with Google drive not saving cache file

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

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.

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 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM