I've django application which uses env variables defined in .bashrc file. The django app is getting the values defined in .bashrc file.
I need to run a python management command in crontab. Usually this is pretty simple to define. Either you can define the management command in script and add it cron or use the command directly in the cron.
But in this can cron is not getting the values of env variables defined in .bashrc file. I've tried almost every doc i found but still its not wokring.
here is the script i used:
WORKON_HOME=/home/ubuntu
PROJECT_ROOT=/home/ubuntu/projects/
. $WORKON_HOME/virtuals/bin/activate
cd $PROJECT_ROOT
python manage.py COMMAND
and in the cron tab i used:
*/2 * * * * /home/ubuntu/test.sh
This setup was working in all other cases.Now there is error when cron is executed. But the script works when manually executed.