[英]Laravel Cron problems in Elastic Beanstalk
我正在尝试在我的 Elastic Beanstalk 环境中执行 cron 作业,但 .ebextensions 脚本似乎无法正常工作。
这是我在配置文件中使用的代码:
files:
"/etc/cron.d/schedule_run":
mode: "000644"
owner: root
group: root
content: |
* * * * * root ./opt/elasticbeanstalk/support/envvars && /usr/bin/php /var/www/html/artisan schedule:run 1>> /var/laralog.log 2>&1
commands:
remove_old_cron:
command: "rm -fr /etc/cron.d/*.bak"
ignoreErrors: true
有谁知道为什么这不起作用?
您可能需要搜索哪些文件包含这些env
变量,但我当前的文件位于/opt/elasticbeanstalk/deployment/env
所以下面提供了我的cron-setup.config
setup.config 的完整代码。
files:
"/etc/cron.d/schedule_run":
mode: "000644"
owner: root
group: root
content: |
* * * * * root . /opt/elasticbeanstalk/deployment/env && /usr/bin/php /var/www/html/artisan schedule:run 1>> /scheduler.log 2>&1
commands:
remove_old_cron:
command: "rm -f /etc/cron.d/*.bak"
但是我不确定在部署到生产环境时这是否是正确的方法。 如果有人发现这个错误,请告诉我。 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.