Python – Long-running Openshift Cron

Long-running Openshift Cron… here is a solution to the problem.

Long-running Openshift Cron

I have a long-running daily cron on OpenShift. It takes several hours to run. I added nohup and ran it in the background. It still seems to time out at the default of 5 minutes (this time it works fine). I didn’t get any errors, it worked very well locally.

nohup python ${OPENSHIFT_REPO_DIR}wsgi/manage.py do_something >> \
${OPENSHIFT_DATA_DIR}do_something_data.log 2> \
${OPENSHIFT_DATA_DIR}do_something_error.log &

Any suggestions would be appreciated.

Solution

I’m lazy. Cut and paste 🙂

I was told that 5 minutes is the limit for free accounts. This includes all background processes. I asked a similar question here.

Related Problems and Solutions