5

Script run in CLI but not in cron

view full story
linux-howto

http://www.linuxforums.org – Hi, I have created a bash script to run as non-root user. The script run well when executed from the CLI but not when scheduled as a cron job. Upon investigating the cause of this issue I found that I have an variable setup in .bashrc ( EXPORT PYTHONPATH = list of directories). When the script is run as a cron job that variable is supposedly not set. I added that variable to the beginning of the scripts and it works fine when executed as a cron job. My query is why the variable does not get set for the user when the script is run as a cron job but works fine when executed from a CLI. I vividly remember that prior to server format I never had this variable a part of my script. It was only added to .bashrc of the non root user and would work fine even as a cronjob. Would appreciate assistance on the same --Syd (HowTos)