Answer the question
In order to leave comments, you need to log in
How to add a task to crontab?
Hello.
There is a script written in Python.
It needs to be run, for example, every minute.
It lies in the /home/ubuntu/shopify/
folder. This folder contains:
/shop.py
/client_secrets.json
/env - a virtual environment in which the supplied dependencies are required to run.
The test.py file takes some data from example.txt.
I do:
sudo crontab -e
In the log I get:
Traceback (most recent call last):
File "/home/ubuntu/shopify/shop.py", line 18, in <module>
scope='https://www.googleapis.com/auth/bigquery')
File "/home/ubuntu/shopify/env/local/lib/python2.7/site-packages/oauth2client/util.py", line 137, in positional_wrapper
return wrapped(*args, **kwargs)
File "/home/ubuntu/shopify/env/local/lib/python2.7/site-packages/oauth2client/client.py", line 2064, in flow_from_clientsecrets
client_type, client_info = clientsecrets.loadfile(filename, cache=cache)
File "/home/ubuntu/shopify/env/local/lib/python2.7/site-packages/oauth2client/clientsecrets.py", line 155, in loadfile
return _loadfile(filename)
File "/home/ubuntu/shopify/env/local/lib/python2.7/site-packages/oauth2client/clientsecrets.py", line 115, in _loadfile
raise InvalidClientSecretsError('File not found: "%s"' % filename)
oauth2client.clientsecrets.InvalidClientSecretsError: File not found: "client_secrets.json"
*/1 * * * * /home/ubuntu/shopify/env/bin/python /home/ubuntu/shopify/shop.py > /home/cronlog.txt 2>&1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question