0

I have an OpenShift DIY cartridge so, i need to do some work daily, i read this article : Run CRON job every 5 minutes on OpenShift (Red Hat Cloud) and do it by making a file in : ~/app-root/runtime/repo/.openshift/cron/minutely/awesome_job.sh with content which is :

  #!/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

so how can i tell if it is working or not? ( or i need to run some app via rhc for running cron job in default DIY cartridge)

1 Answer 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.