Reputation: 1170
I have tried to setup a simple cron job running on openshift but once I have pushed the file to openshift and then login and search for the file it does not seem to be there and there is not log output.
#! /bin/bash
date > $OPENSHIFT_LOG_DIR/last_date_cron_ran
find /var/lib/openshift/53760892e0b8cdb5e9000b22 -name awesome_job
for which it finds nothing.Any ideas which might help as I am at loss why is it not working.
Upvotes: 1
Views: 1951
Reputation: 150
You should also put a file named "jobs.allow" under your .openshift/cron/minutely/. So your cron jobs will be executed. For your ref: https://forums.openshift.com/daily-cron-jobs-not-getting-triggered-automatically
And the reason you can find your awesome_job vis ssh login is because it is under /var/lib/openshift/53760892e0b8cdb5e9000b22/app-root/runtime/repo/.openshift
, so the command find
does not search any files under folders named with .
prefixed.
Upvotes: 0
Reputation: 1170
The issue was not with cron but with the golang cartridge I was using which was removing the .openshift directory.
https://github.com/smarterclayton/openshift-go-cart/issues/10
Upvotes: 1