Hi railers, I have a quick question - I think it will be answered fairly easily methinks. What''s the best practice (naming conventions, where to place in project etc) for creating a job to be ran every day? For example - want to run a ruby script to grab an xml feed and persist it in a database. Thanks Andrew --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 5/22/08, chalkers <andrew-zM6pO0Cwmypg9hUCZPvPmw@public.gmane.org> wrote:> > Hi railers, > > I have a quick question - I think it will be answered fairly easily > methinks. > > What''s the best practice (naming conventions, where to place in > project etc) for creating a job to be ran every day? > > For example - want to run a ruby script to grab an xml feed and > persist it in a database.Put the job in the model. then run it with script/runner, via cron or whatever. script/runner -e production Foo.daily_task -- Greg Donald http://destiney.com/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That''s bloody fantastic! Thank you. On May 22, 7:35 pm, "Greg Donald" <gdon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 5/22/08, chalkers <and...-zM6pO0Cwmypg9hUCZPvPmw@public.gmane.org> wrote: > > > > > Hi railers, > > > I have a quick question - I think it will be answered fairly easily > > methinks. > > > What''s the best practice (naming conventions, where to place in > > project etc) for creating a job to be ran every day? > > > For example - want to run a ruby script to grab an xml feed and > > persist it in a database. > > Put the job in the model. then run it with script/runner, via cron or whatever. > > script/runner -e production Foo.daily_task > > -- > Greg Donaldhttp://destiney.com/--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
You can find a couple alternative solutions here: http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/b6accea9d78d6e2e/6d29aadec26fbbd3?hl=en&lnk=gst&q=mcintyre#6d29aadec26fbbd3 I suspect Andrew''s solution at the bottom of that post is probably best. Better than mine yes:-) good luck! Tim On May 22, 11:32 am, chalkers <and...-zM6pO0Cwmypg9hUCZPvPmw@public.gmane.org> wrote:> Hi railers, > > I have a quick question - I think it will be answered fairly easily > methinks. > > What''s the best practice (naming conventions, where to place in > project etc) for creating a job to be ran every day? > > For example - want to run a ruby script to grab an xml feed and > persist it in a database. > > Thanks > > Andrew--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks Tim, that sounds a great alternative - putting things in tasks in tasks and actions in a controller! Simple, logical. Model was a bit out of place for what I needed. On May 22, 8:26 pm, Tim McIntyre <mcintyre....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You can find a couple alternative solutions here: > > http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/... > > I suspect Andrew''s solution at the bottom of that post is probably > best. Better than mine yes:-) > > good luck! > Tim > > On May 22, 11:32 am, chalkers <and...-zM6pO0Cwmypg9hUCZPvPmw@public.gmane.org> wrote: > > > Hi railers, > > > I have a quick question - I think it will be answered fairly easily > > methinks. > > > What''s the best practice (naming conventions, where to place in > > project etc) for creating a job to be ran every day? > > > For example - want to run a ruby script to grab an xml feed and > > persist it in a database. > > > Thanks > > > Andrew--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
That seems a better alternative. Didn''t seem quite right in the model, and in the controller it''s a bit out of place. Tasks sounds like what the thing is. A task :) On May 22, 8:26 pm, Tim McIntyre <mcintyre....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You can find a couple alternative solutions here: > > http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/... > > I suspect Andrew''s solution at the bottom of that post is probably > best. Better than mine yes:-) > > good luck! > Tim > > On May 22, 11:32 am, chalkers <and...-zM6pO0Cwmypg9hUCZPvPmw@public.gmane.org> wrote: > > > Hi railers, > > > I have a quick question - I think it will be answered fairly easily > > methinks. > > > What''s the best practice (naming conventions, where to place in > > project etc) for creating a job to be ran every day? > > > For example - want to run a ruby script to grab an xml feed and > > persist it in a database. > > > Thanks > > > Andrew--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I think the point Andrew was making was to take the code out of the controller and put it in a task. As opposed to what the john was doing by having the code in a controller and calling it with curl. I agree that the model doesn''t feel like a good place for this kind of thing:-) On May 22, 1:42 pm, chalkers <and...-zM6pO0Cwmypg9hUCZPvPmw@public.gmane.org> wrote:> Thanks Tim, that sounds a great alternative - putting things in tasks > in tasks and actions in a controller! Simple, logical. Model was a bit > out of place for what I needed. > > On May 22, 8:26 pm, Tim McIntyre <mcintyre....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > You can find a couple alternative solutions here: > > >http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/... > > > I suspect Andrew''s solution at the bottom of that post is probably > > best. Better than mine yes:-) > > > good luck! > > Tim > > > On May 22, 11:32 am, chalkers <and...-zM6pO0Cwmypg9hUCZPvPmw@public.gmane.org> wrote: > > > > Hi railers, > > > > I have a quick question - I think it will be answered fairly easily > > > methinks. > > > > What''s the best practice (naming conventions, where to place in > > > project etc) for creating a job to be ran every day? > > > > For example - want to run a ruby script to grab an xml feed and > > > persist it in a database. > > > > Thanks > > > > Andrew--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---