I am trying to use openface for face recognition. I am able to run the code properly without using crontab but as soon as i try to run the code using crontab i am getting error as /usr/bin/env: th: No such file or directory
i searched on the internet and i found that it is having some trouble while finding the path of th
so i have moved all the files using command cp -R /home/cdh/torch/install/bin/* /usr/bin/th
but still i am getting the same error. Please help as i am stuck in this issue and needed it to be done badly. My workflow.sh file which i am giving my cronjob to run is below.
workflow.sh :
#!/bin/bash
export PATH='/bin/bash'
export PATH='/bin/python'
echo "Model running"
cd /home/cdh/openface-master
/bin/python /xxx/xxx/openface-master/demos/classifier_updated.py
As i mentioned earlier if i run only /bin/python /xxx/xxx/openface-master/demos/classifier_updated.py
i am getting the desired output only if i do using crontab i am getting error.
Seems to me the issue with using export inside script. You are replacing the existing path variables to lastly as /bin/python. Please try below:
export PATH=$PATH:/bin/python/:/bin/bash
Note: /bin/bash should be aleady in the path variable but since you are using updated that here.