Created
January 16, 2022 07:48
-
-
Save manojahi/a16812b247057d51f5bcb0baeeac2cca to your computer and use it in GitHub Desktop.
Cronjob in elastic beanstalk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: | |
/usr/local/bin/my_cron_script.sh: | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
#!/bin/bash | |
export $(cat /opt/elasticbeanstalk/deployment/env | xargs) | |
source $PYTHONPATH/activate | |
python3 /var/app/current/manage.py my_process | |
/etc/cron.d/my_cron: | |
mode: "000644" | |
owner: root | |
group: root | |
content: | | |
0 * * * * root /usr/local/bin/my_cron_script.sh >> /var/log/my_cron.log 2>&1 | |
commands: | |
rm_old_cron: | |
command: "rm -fr /etc/cron.d/*.bak" | |
ignoreErrors: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment