Issue with google drive saving


#1

I’m having a little problem doing backups with google drive, and I’m not sure why. Whenever I run the backup script manually it works fine, but when I check /var/mail for my cronjob status, I get the error that the storage gcd://duplicacy/backups does not exist, yet it does. ¯\_(ツ)_/¯


#2

It’s likely cron job runs as a different user so keychain/credentials are not available.

You can add -d flag to duplicacy running from your cron job to see what it is trying to do and where does it fail (e.g. while reading google token, etc)


#3

Yeah, it fails while reading the token.


#4

Do you have any idea how I could fix it?


#5

I don’t have much experience with cron, and I’m not sure whether it re-creates complete user environment including keychains, but you can try this: ubuntu - How to run a cron job as a specific user? - Super User

If turns out if this is not the case – you can always place google credentials in the preferences file or even environment variables Passwords, credentials and environment variables. Set permissions appropriately so that only that user can read them and then see above how to run cron job as another user.