I have a very long (and messy) crontab (on my Mac). So I started cleaning it up by introducing variables for instance. Then I realized that concatenating variables (just like in a Bash script) does not work in my crontab. This is what I have:
SHELL=/bin/bash
HOME=/Users/leuchtturm
# [1] Previously had this, but this does not seem to work
# $HOME is not being evaluated? Why?
#
# VIRTUALENV_PYTHON=$HOME/.virtualenvs/py361/bin/python
# Now I have this (elaborated)
VIRTUALENV_PYTHON=/Users/leuchtturm/.virtualenvs/py361/bin/python
# the crontab entry
# Here $HOME is being expanded, but not in the example above [1]
#
*/2 * * * * source $HOME/.config_vars && $VIRTUALENV_PYTHON $HOME/workspace/monitoring/check_server.py
So in this line
VIRTUALENV_PYTHON=$HOME/.virtualenvs/py361/bin/python
the variable $HOME
is not being evaluated. My cron log has an entry that says "path not found".
Can someone enlighten me? Thanks!