Gdrive: GDrive w/ CRON

Created on 6 Sep 2017  路  4Comments  路  Source: prasmussen/gdrive

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

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>/.gdrive and it should work.

All 4 comments

@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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

loctong picture loctong  路  4Comments

4getit picture 4getit  路  4Comments

JuliArianes picture JuliArianes  路  6Comments

cod3r-dev picture cod3r-dev  路  7Comments

unim21 picture unim21  路  4Comments