Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top