Forum: Ruby on Rails make a method in a controller do something by console script

Posted by klaas debeuf (Guest)
on 2006-02-28 14:22
is there a possibility to automate a method in a controller by a ruby 
script ,

i have written a method which is taking rssfeeds from other sites and 
puts it to my database , but i want to have this method called each 15 
minutes , can you do it by a console script or do i have build a 
stand-alone program?
can somebody put me on the correct track?or give me some hints

greets

Klaas
Posted by Mathias Stjernström (Guest)
on 2006-02-28 15:52
(Received via mailing list)
Hi.
You could use the runner script to execute your method(s).

For example:

ruby script/runner -e production 'Import.run()'

Where 'Import' is the model and 'run' is the method.

Put it in crontab and you are good to go!

--
Mathias Stjernstrom
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.