【发布时间】:2017-04-24 12:55:43
【问题描述】:
我有一个使用 ruby 1.9.3 的 rails 3.2 应用程序
我们需要通过 container_commands 运行一个 cron 作业。
目前我在.ebextensions 目录中有一个common.config 文件,其中包含以下内容
container_commands:
04_clear_old_epubs:
command: "cat .ebextensions/clear_old_epubs_cron.txt > /etc/cron.d/clear_old_epubs_cron && chmod 644 /etc/cron.d/clear_old_epubs_cron"
leader_only: true
然后在我的clear_old_epubs_cron.txt文件中
*/5 * * * * root /usr/bin/php rm -rf /var/app/current/public/epub-download-1/* > /dev/null
#
我从AWS Elastic Beanstalk, running a cronjob 接受的答案中得到了这个
cron 不会像预期的那样清除文件夹。不确定是什么阻止了 cron 运行,或者它是否正在运行,但还有其他问题。
任何人都可以看到错误或缺失的东西吗?
【问题讨论】:
标签: ruby-on-rails ruby amazon-web-services cron cron-task