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 [email protected] -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.

jasonwryan
  • 71,734
  • 34
  • 193
  • 226
lwaskie
  • 21
  • 3
  • 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](http://unix.stackexchange.com/questions/29578/how-can-i-execute-date-inside-of-a-cron-tab-job)) – steeldriver Aug 23 '16 at 00:10

1 Answers1

0

os.environ['ZENDESK_API_USER'] = '[email protected]' os.environ['ZENDESK_API_TOKEN'] = 'aaAAAAaaaA' (token)

I added that to the script itself, works fine.

lwaskie
  • 21
  • 3