2

Can someone give me direction how to setup a cron job on EngineYard that checks the database every x minutes and performs a task on them?

Most basically, I'm not sure how to have the script access the database.

Winfield
  • 18,985
  • 3
  • 52
  • 65
99miles
  • 10,942
  • 18
  • 78
  • 123

2 Answers2

3

One way to do this would be to first create a rake task for your application. With a rake task you automatically have access to your environment database and code structure.

Then you can schedule the task as a cron job in the Engine Yard Admin page. You find it in Dashboard > More Options > Crontabs

The command to execute a rake task is like this:

cd /data/YourAppName/current && RAILS_ENV=production rake namespace:task
DanneManne
  • 21,107
  • 5
  • 57
  • 58
0

Assuming you're on AppCloud, we fully support cron tasks via the UI.