When trying to use cron to automate backup the following is logged in the log file:
Authentication needed
Go to the following url in your browser:
https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=Et Cetera
Enter verification code: Failed reading code: EOF
As per other Issues I have set the PATHs in the crontab already.
CRON Entry: 37 14 * * Wed gdrive update 0B0llAyNlUCAWbzk4UHVmNUg5aWM /usr/local/bin/cronlog.log >> /usr/logs/gdrive.log 2>&1
Entered in sudo crontab. user crontab entry gets a permission denied error for reading the .json file I think.
running the command outside of cron works with and without sudo.
Running Ubuntu Server 16.04.3 LTS
@dominion66 Could you just chmod 777 the token file to make it accessible to the root user?
Thanks, I gave it a try and got the same responses as before running from CRON. Running the same command outside of CRON works fine.
I realized the problem is the root user expects the token file in a different directory.
Use the flag --config /home/<you>/.gdrive and it should work.
That did the trick and works beautifully. Thanks so Much!
Most helpful comment
I realized the problem is the root user expects the token file in a different directory.
Use the flag
--config /home/<you>/.gdriveand it should work.