Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error with cron #93

Open
epicbastion opened this issue Sep 9, 2015 · 0 comments
Open

error with cron #93

epicbastion opened this issue Sep 9, 2015 · 0 comments

Comments

@epicbastion
Copy link

ok so I can run this shell file from a console with sudo just fine but when i put it in a cron.d file and try and get it to run it as root it gives me this. What am I doing wrong or how can i fix this so it will run.

Subject: Cron root@littlebigservers /data/sh/gsync.sh
Content-Type: text/plain; charset=ANSI_X3.4-1968
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>

DEBUG: ENoTTY(): File "/usr/local/bin/gsync", line 55, in
crawler = Crawler(p, dest)
File "/usr/local/lib/python2.7/dist-packages/libgsync/crawler.py", line 57, in init
info = self._drive.stat(self._dst)
File "/usr/local/lib/python2.7/dist-packages/libgsync/drive/init.py", line 507, in stat
ents = self._query(parentId = parentId)
File "/usr/local/lib/python2.7/dist-packages/libgsync/drive/init.py", line 767, in _query
service = self.service()
File "/usr/local/lib/python2.7/dist-packages/libgsync/drive/init.py", line 231, in service
credentials = self._obtainCredentials()
File "/usr/local/lib/python2.7/dist-packages/libgsync/drive/init.py", line 328, in _obtainCredentials
raise ENoTTY

Error:

EDIT: So for the rest of us who do not know what this error is, if you set up your credentials from your normal sudo user and then try to run this as root from cron it gives you this error. You have to run the script or the command from root not sudo but actual root to get credentials from google drive for your root account in order for this to run. Not sure how folks who do not use root are expected to be able to get this to run in a cron job, but I actually go against the ubuntu code and use root so this is kind of solved for me but anyone who follows the proscribed methods may not be able to get gsync to run in cron.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant