Skip to content

Instantly share code, notes, and snippets.

@elgalu
Created June 5, 2013 15:45
Show Gist options
  • Save elgalu/5714909 to your computer and use it in GitHub Desktop.
Save elgalu/5714909 to your computer and use it in GitHub Desktop.
Cron Job Idea for OpenShift at /.openshift/cron/hourly/foreman
#!/bin/bash
pushd ${OPENSHIFT_REPO_DIR} > /dev/null
# Set env vars
source ${OPENSHIFT_REPO_DIR}/.env.openshift
# Run jobs
# bundle exec rake jobs:work
bundle exec foreman start > ${OPENSHIFT_RUBY_LOG_DIR}/foreman.log &
# To view the logs:
# rhc tail huginn -f ruby-1.9/logs/foreman.log
# Go back to initial directory
popd > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment