开发者

Cron job on EngineYard

开发者 https://www.devze.com 2023-01-29 04:27 出处:网络
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?

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.


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消