On 8/6/07, Andrew Fong
<FongAndrew-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> Hi all,
>
> Noob question, so please bear with me.
>
> I want my rails app to periodically do some maintenance work (e.g.
> once a day). The maintenance commands can be called by an action under
> a maintenance controller.
>
> A friend suggested using crontab, but I''m not sure how to use
crontab
> to call an action in rails.
Use a runner script which loads up the rails environment for you.
Create a class file and put it in the lib directory. Then you can
call class methods in the file by running:
ruby script/runner "Myclass.mymethod"
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---