0

我有一个 OpenShift DIY 墨盒,所以我需要每天做一些工作,我读了这篇文章: 在 OpenShift (Red Hat Cloud) 上每 5 分钟运行一次 CRON 作业 ,并通过在 ~/app-root/runtime 中创建一个文件来完成/repo/.openshift/cron/minutely/awesome_job.sh 内容为:

  #!/bin/bash
    #chmod +x ~/app-root/runtime/repo/.openshift/cron/minutely/awesome_job.sh 
    #minute=$(date '+%M')
    #if [ $minute == 12 ]; then
    minute=$(date +%M)
    if [[ $minute =~ [05]$ ]]; then
        date > ~/app-root/runtime/repo/www/sie.txt  

    fi

那我怎么知道它是否工作?(或者我需要通过 rhc 运行一些应用程序以在默认 DIY 墨盒中运行 cron 作业)

4

1 回答 1

0

I think you need to change

date > ~/app-root/runtime/repo/www/sie.txt

to

echo date > ~/app-root/runtime/repo/www/sie.txt

so that the results of the "date" command will actually get pushed into that file

于 2014-11-23T19:02:58.960 回答