Cronjob for controller/action

I’ve (currently) got some code, in it’s own action in a controller. It
fetches email from imap and does all kinds of mojo with it. What I need
to do is have this run via a cronjob every so and so many minutes. Now,
currently, to run it I have to load http://url/controller/action for
that action. I want to run this silently in the backround on the server
running the app, so that things will seem automatically.

I am considering running curl or wget in a cronjob, but are there any
ways of doing this that are less caveman-ish?

Thats what you want:

http://wiki.rubyonrails.com/rails/pages/RunnerScript

You’ll need BackgrounDRb. If you’re german, i have written an article in
my
Blog just about that…
http://siebert-wd.de/articles/2006/08/16/regelmaessige-aufgaben-mit-backgroundrb-erledigen

2006/8/24, Stian H. [email protected]:

ways of doing this that are less caveman-ish?


Posted via http://www.ruby-forum.com/.


Michael S. [email protected]

www.siebert-wd.de - Gedanken lesen
www.stellar-legends.de - Weltraum-Browsergame im Alpha-Stadium

scripts/runner – runner in the scripts directory is designed for
recreating the rails environment to run rails code from a cron job,
using all of your actions and etc. It has documentation in the usual
places.



John B.