【发布时间】:2023-03-31 10:16:01
【问题描述】:
我正在尝试在我的项目上设置一个 cron 作业以在 15 分钟后发送电子邮件。
这是在 django.config 中
04_cronjb:
command: "cat .ebextensions/cron-linux.config > /etc/cron.d/crontab && chmod 644 /etc/cron.d/crontab"
leader_only: true
这是我的 cron-linux.config 文件
files:
"/etc/cron.d/mycron":
mode: "000644"
owner: root
group: root
content: |
* * * * * source /opt/python/current/env && python /opt/python/current/app/manage.py cronjb
一切都成功部署,但我没有收到任何电子邮件。 Cronjb 脚本正在运行,我已经对其进行了测试。所以错误是这两个文件之一。 是不是有什么错误?
【问题讨论】:
标签: django amazon-web-services cron cron-task