AWS ebextensions crontab错误:没有这样的文件(但它存在)

时间:2016-05-15 14:14:49

标签: amazon-web-services cron yaml elastic-beanstalk

我正在运行亚马逊网络服务Web服务器层弹性beanstalk应用程序,我想每3个小时运行一个脚本。我已经搜索了很多,这个问题的答案似乎是创建一个" .ebextensions"文件夹,其.config文件如下所示:

commands:
  01_cronjobs:
    leader_only: true
    command: "cat .ebextensions/etss.txt > /etc/cron.d/crontab_etss && chmod 644 /etc/cron.d/crontab_etss"

不幸的是,当我这样做时,应用程序无法部署错误:

[Instance: xxx] Command failed on instance. Return code: 1 Output: cat: .ebextensions/etss.txt: No such file or directory. command 01_cronjobs in .ebextensions/config.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

我的.ebextensions文件夹中有一个etss.txt文件,如下所示:

0 */3 * * * /usr/bin/php download_etss_tar.php > /dev/null
#blank newline here

我也尝试将它放在root中并在那里引用它。为什么cron找不到我知道的文件存在于zip中?我在这里做错了什么?

此外,我也尝试使用完整的文件名,但无济于事:

Command failed on instance. Return code: 1 Output: cat: /var/www/html/.ebextensions/etss.txt: No such file or directory. command 01_cronjobs in .ebextensions/etss.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

0 个答案:

没有答案