Issue
I'm trying to run a python script from cron, but its not running properly so I'm assuming its the different path env variable. Is there anyway to change the variable within a python script?
Solution
You shouldn't need to set the PATH from within the python script. Instead, put something like
USER=joe
HOME=/home/joe
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/some/other/path
PYTHONPATH=/home/joe/pybin
MAILTO=joe
LANG=en_US.UTF-8
#min hr day mon dow
*/5 12 * * * reminder.py 'Eat lunch'
at the top of your crontab. These environment variables will then be available to all cron jobs run through your crontab.
Answered By - unutbu Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.