Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"sh: sysctl Command not Found " for Mac OS X running a cron job

I have a python script, script.py, and am using cron to run this script periodically. The script runs as expected, but once the cron job finishes, I get the following error in /var/mail/[myusername]:

sh: sysctl Command Not Found

The following is the cron job:

0 14  * * * PATH=$PATH:/usr/sbin PYTHONPATH=/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ /usr/bin/python2.7 ~/.../script.py

I was told to include both PATH and PYTHONPATH in the task (as before, python wouldn't recognize several modules I had imported and had installed), so at this point, I'm not sure what the problem could be

like image 478
Ricardo Iglesias Avatar asked Feb 16 '17 22:02

Ricardo Iglesias


1 Answers

On some Macs, sysctl is located in /sbin/ instead of /usr/sbin/. You should add /sbin to your PATH variable

like image 69
wpercy Avatar answered Oct 15 '22 16:10

wpercy