Simon
asked on
Script error when run as a cronjob.
Linux Centos, When I run a script manually, it works perfectly but when I run it as a cronjob it throws an error from within the script. My script is a simple launcher for a Python script as follows:
#!/bin/sh
#c21Launcher.sh
cd /
cd /usr/local/bin
Python2.7 /root/amqp_to_db/amqp_to_d b.py &
cd /
The error that I get is that "Python2.7 is not recognised as a command!
#!/bin/sh
#c21Launcher.sh
cd /
cd /usr/local/bin
Python2.7 /root/amqp_to_db/amqp_to_d
cd /
The error that I get is that "Python2.7 is not recognised as a command!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you assume the current directory is in the PATH,
ASKER
so should it be:
cd /
/usr/local/bin/Python2.7 /root/amqp_to_db/amqp_to_d b.py
?
cd /
/usr/local/bin/Python2.7 /root/amqp_to_db/amqp_to_d
?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
your original one would work with "./python2.7 ...." but better to use use "/usr/local/bin/Python2.7 ...."
ASKER
cd /
cd /usr/local/bin
That is where the Python2.7 file is!