- Problem: How can I work around the Google drive token expiring every week?
- Ubuntu 20.04.1 LTS
- rclone v1.53.3
- os/arch: linux/amd64
- go version: go1.15.5
- Backing up to to Google Drive, using my own client id and secret
- Command: /usr/bin/rclone sync --transfers 30 --progress --verbose --stats 5m --max-backlog 999999 <source_dir> G-Drive:
- Error message: 2021/02/25 04:30:07 Failed to create file system for "G-Drive:": couldn't find root directory ID: Get "here... ... googleapis.com/drive/v3/files/root?alt=json&fields=id&prettyPrint=false&supportsAllDrives=true": couldn't fetch token - maybe it has expired? - refresh with "rclone config reconnect G-Drive:": oauth2: cannot fetch token: 400 Bad Request
"error_description": "Token has been expired or revoked."
I am using rclone to backup from headless Linux to Google Drive. I have set up my own credentials (as I read that it runs faster) and have my own client id and secret. The backup all works fine for 1 week.
My problem is that the token from Google expires after 1 week and I have to intervene manually to re-authorise the token by running "rclone config reconnect :". This is less than ideal.
Reading this post: ...forum.rclone.org/t/google-drive-cannot-refresh-token-after-a-few-days/22036/18 (add https), I realise that this is a Google policy for apps in "Testing".
So my questions are...
- Has anyone had any success getting Google tokens authorised permanently? Or at least longer than 1 week every time. I have looked into getting my OAuth connection verified, but it appears I need to own the website rclone.org to do this.
- Can a headless "rclone config reconnect..." be scripted?
- Would I be better to use the default client id? I presume it doesn't expire, but what is the performance impact?
- Any other suggestions?