i am using rclone on my qnap nas to create backup to google, i made a shell script that looks like this
#!/bin/bash
if pidof -o %PPID -x "uploadfilms.sh"; then
exit 1
fi
rclone copy /share/Film gcrypt:Film --progress --fast-list --checkers 10 --transfers=10 --tpslimit=3 --log-file=/share/Tom/rclone.txt -v
exit
when i run this script in putty terminal on my nas it works perfect,
but whenever i want it to run as a cronjob it throws me this error
2022/09/13 17:17:01 INFO : Starting transaction limiter: max 3 transactions/s with burst 1
2022/09/13 17:17:12 Failed to create file system for "gcrypt:Film": failed to make remote "gdrive:Private" to wrap: couldn't find root directory ID: Get "https://www.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 gdrive:": oauth2: cannot fetch token: 401 Unauthorized
Response: {
"error": "deleted_client",
"error_description": "The OAuth client was deleted."
}
rclone config file
[gdrive]
type = drive
client_id = xxxxx.apps.googleusercontent.com
client_secret =xxx
scope = drive
token = {"access_token":"xxx"}
team_drive =
id and secret has been redacted
[gcrypt]
type = crypt
remote = gdrive:Private
password =xxx
password has been redacted