0

So basically I have a python script that checks a webpage for unassigned tickets and notifies me if there is any. My goal is to have a crontab file that runs the .py file every 2 minutes.

If I run the .py file using the following in terminal:

python check.py -u user@email.com -t aaAAAaAAaaAAAa

It functions as desired. However I need to figure out how to add the above user and API token, so that every two minutes the crontab runs the .py using the user/token.

My crontab so far is as follows

2 * * * * /usr/bin/python /Users/usr/Downloads/check-master/check.py

If you could point me in the right direction that would be great, or any advice you can give, thanks in advance.

  • 1
    I'm not sure I understand what you're asking - AFAIK you should be able to add arguments to commands within a crontab in exactly the same way as you do in the interactive shell (although beware of any that may contain unescaped percent signs) – steeldriver Aug 23 '16 at 0:10
0

os.environ['ZENDESK_API_USER'] = 'user@email.com' os.environ['ZENDESK_API_TOKEN'] = 'aaAAAAaaaA' (token)

I added that to the script itself, works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.