Crontab always try to load mysql-python image from my home directory, while the library image is actually in /Library/Python/2.7/site-packages/MySQL_python… How can I point crontab to the right place? Without reinstall mysql-python as a static library?
I work on MAC OS 10.7.
Thanks.
Run
envat your command-line and copy its output. Add that to the top of your crontab, as that will set the environment for the cron to run – this should do the trick. You can then remove unwanted environment variables at your own leisure.Reference for Mac OS X:
crontab file
When you add cron jobs (using conrtab -e), they are neither run under your Mac OS X login nor under a tcsh shell, so you can also set envrionment variables in your crontab which will get used when executing cron actions.
Source: Peter’s Mac OS X Notes.
Notice that the environment setting on cron does NOT require you to add the
exportcommands. Drop them at the top of the cron file and that will do it.