How do i tell if a cron job on OpenShift is working or not?

519 views Asked by At

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

There are 1 answers

0
AudioBubble On

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