I have a Django application running on AWS Elastic beanstalk. I need to run a cron job that runs a Django management command every 10 minutes ( python manage.py test ). For this, I created the .ebextensions / cron.config file.
.ebextensions/cron.config
container_commands:
01_some_cron_job:
command: "cat .ebextensions/cron_test.txt > /etc/cron.d/cron_test && chmod 644 /etc/cron.d/some_cron_job"
.ebextensions / cron_test.txt
*/10 * * * * /opt/python/run/venv/bin/python34 /opt/python/current/app/manage.py test
Is it right to run the Django control command as a cron job in an AWS elastic beanstalk? Do I need to activate the virtual environment before running the command?
source
share