【发布时间】:2020-08-07 09:44:39
【问题描述】:
我试图在 AWS Elastic Beanstalk 环境中的 CRON 中每分钟触发 js 文件。然而,该文件永远不会被触发。
这是我的 EB cron 配置。我把它放在.ebextensions 并命名为cron-linux.config:
files:
"/etc/cron.d/mycron":
mode: "000644"
owner: root
group: root
content: |
* * * * * root /usr/local/bin/myscript.sh
"/usr/local/bin/myscript.sh":
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
date > /tmp/date // inside here I can see actual date so cron works
node ./var/app/current/scripts/testCrobJob.js //this file is not fired
exit 0
commands:
remove_old_cron:
command: "rm -f /etc/cron.d/mycron.bak"
我怎样才能让它工作?
【问题讨论】:
标签: amazon-web-services cron amazon-elastic-beanstalk