Django AWS Elastic Beanstalk .ebextensions cronjob
I have successfully set up a cron in AWS extensions to run a Django command at a certain time. Although, I have unsuccessfully been able to run/add multiple commands at different times.
Question: if I wanted to run multiple Django commands as cron jobs, would I add new duplicate config files (like below) within in my .ebextensions folder OR is it possible to add a new Django command (w/ different time) to the one below?
.ebextensions
-cron_job.config
files:
/usr/local/bin/cron_activity_use.sh:
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
source /opt/python/run/venv/bin/activate
source /opt/python/current/env
cd /opt/python/current/app
docker exec `docker ps --no-trunc -q | head -n 1` python manage.py cron_activity_use
/etc/cron.d/m_cron:
mode: "000644"
owner: root
group: root
content: |
*/10 * * * * root /usr/local/bin/cron_activity_use.sh
commands:
rm_old_cron:
command: "rm -fr /etc/cron.d/*.bak"
ignoreErrors: true