Issue with google drive saving

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. ¯\_(ツ)_/¯

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)

2 Likes

Yeah, it fails while reading the token.

Do you have any idea how I could fix it?

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.

Tried the running as another user, get this:

Storage set to gcd://duplicacy/backups
Enter the path of the Google Drive token file (downloadable from https://duplicacy.com/gcd_start):Failed to load the Google Drive storage at gcd://duplicacy/backups: open : no such file or directory
Storage set to gcd://duplicacy/backups
Enter the path of the Google Drive token file (downloadable from https://duplicacy.com/gcd_start):Failed to load the Google Drive storage at gcd://duplicacy/backups: open : no such file or directory

bumpity bump bump gotta love the character minimum

The error indicated that it was getting an empty path to the token file. How did you pass the path to Duplicacy?

oh…

ohhhhh

I thought that when I entered it when I did the backups manually that it saved the path in like .duplicacy or something… What’s a good way to store and pass the path?

bumpity bump bumpity bump

i just store it inside the .duplicacy/ folder.

but how do I like tell duplicacy to look for the path

You are supposed to do that when you init the storage.

You can also just add it in the preferences file:

cd .duplicacy/
cat preferences

[
    {
        "name": "default",
        "repository": "",
        "storage": "gcd://backups/duplicacy",
        "encrypted": true,
        "no_backup": false,
        "no_restore": false,
        "no_save_password": false,
        "nobackup_file": "",
        "keys": {
            "gcd_token": "/root/duplicacy-repositories/myrepo/.duplicacy/gcd-token.json" // <--- create this line
        }
    }
]
2 Likes

@personchose is this issue solved?


For anyone: Feel free to use the :heart: button on the posts that you found useful.
For the OP of any #support topic: you can mark the post that solved your issue by ticking the check4%20(2) box under the post. That of course may include your own post :slight_smile: