Hi, I''m developing a rails app that needs to run scheduled tasks, does someone knows how can I do that? I''ve tried backgroundrb, but without success... Looks like backgroundrb is outdated with my version of rails (3.0.3), Does anybody confirms? Thanks in advance, --------------------------------------------------- Douglas Fonseca Engenharia da Computação 2010 Universidade Estadual de Campinas -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Not sure about backgroundrb, but you could also check out delayed_jobs (though it sounds like it won''t be updated for a while), Resque (if your requirements are more high-end), or the top answer here: http://stackoverflow.com/questions/897605/ruby-on-rails-how-to-run-things-in-the-background But if it''s just a scheduled task, how about plain old cron? Or see more discussion (and more gems) here: http://stackoverflow.com/questions/3632129/is-railss-delayed-job-for-cron-task-really Fun! On Jan 11, 5:14 pm, Douglas Fonseca <douglasinfo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > I''m developing a rails app that needs to run scheduled tasks, does someone > knows how can I do that?-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Douglas, I have been using cron tasks that invoke curl that invokes the routes that perform the periodic tasks for several years. This works on all versions of Rails (of course you have to be running *nix). I gave up on using Rails plugins, etc. because every time I did an update, the darned things broke (and now they seem to have gone away entirely). Donz On 1/11/2011 5:14 PM, Douglas Fonseca wrote:> Hi, > I''m developing a rails app that needs to run scheduled tasks, does > someone knows how can I do that? > I''ve tried backgroundrb, but without success... > Looks like backgroundrb is outdated with my version of rails (3.0.3), > Does anybody confirms? > Thanks in advance, > --------------------------------------------------- > Douglas Fonseca > Engenharia da Computação 2010 > Universidade Estadual de Campinas > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On Jan 12, 2:54 pm, "Donald R. Ziesig" <don...-FWDIqG1pcu4dnm+yROfE0A@public.gmane.org> wrote:> Douglas, > > I have been using cron tasks that invoke curl that invokes the routes > that perform the periodic tasks for several years.Do you wrap some security on those routes at the web-server level or in the application? If you secure at the webserver, do you do it by ip address or user/password O. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Quoting Owain <owain.mcguire-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > > On Jan 12, 2:54 pm, "Donald R. Ziesig" <don...-FWDIqG1pcu4dnm+yROfE0A@public.gmane.org> wrote: > > Douglas, > > > > I have been using cron tasks that invoke curl that invokes the routes > > that perform the periodic tasks for several years. > > Do you wrap some security on those routes at the web-server level or > in the application? If you secure at the webserver, do you do it by ip > address or user/password >Look at local_request? method in ActionController. HTH, Jeffrey -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
> > Look at local_request? method in ActionController. >Jeffrey, Certainly another option but I would prefer not to have "network config" logic in my application if I can help it. If you want to manage all of the housekeeping jobs from a remote curl or put in load balancers you would need to change code. I prefer to protect resources like this in my httpd.conf that defines the server and network environment. O. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Quoting Owain <owain.mcguire-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > > > Look at local_request? method in ActionController. > > > > Jeffrey, > > Certainly another option but I would prefer not to have "network > config" logic in my application if I can help it. If you want to > manage all of the housekeeping jobs from a remote curl or put in load > balancers you would need to change code. I prefer to protect > resources like this in my httpd.conf that defines the server and > network environment. >Whatever. Then the question is one for the Apache forums, not Rails. Jeffrey -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Whatever. Then the question is one for the Apache forums, not Rails. >Indeed. However, it is of interest to solicit views as to how other people approach this problem. Cron with Curl looks a simple and sensible way of automation. What''s Donz''s approach? O. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
On 1/12/2011 1:37 PM, Jeffrey L. Taylor wrote:> Quoting Owain<owain.mcguire-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: >> >> On Jan 12, 2:54 pm, "Donald R. Ziesig"<don...-FWDIqG1pcu4dnm+yROfE0A@public.gmane.org> wrote: >>> Douglas, >>> >>> I have been using cron tasks that invoke curl that invokes the routes >>> that perform the periodic tasks for several years. >> Do you wrap some security on those routes at the web-server level or >> in the application? If you secure at the webserver, do you do it by ip >> address or user/password >> > Look at local_request? method in ActionController. > > HTH, > Jeffrey >I restrict the ip to 0.0.0.0 (localhost) so no one outside the server can use the route. If someone is able to hack into the server itself, all bets are off. :-( . So far I haven''t had any problems, and the site has been up for 3.5 years so far. local_request? would work too. Donz -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Jan 13, 2011, at 12:36 PM, Donald R. Ziesig wrote:> I restrict the ip to 0.0.0.0 (localhost) so no one outside the > server can use the route. If someone is able to hack into the > server itself, all bets are off. :-( . So far I haven''t had any > problems, and the site has been up for 3.5 years so far. > > local_request? would work too.I need to do something similar -- keep all but cron requests from the same server from tripping a particular method in my controller. Can you elaborate on how local_request? could be used for that purpose? I looked at the documentation, and it appears to be a test you can run on an exception, but I''m not clear how to employ it -- what would I use to raise the exception in the first place? Is it as simple as this? def my_api_method send_out_a_bunch_of_mail if local_request? end My gut tells me no, there''s an object missing here. Walter -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Quoting Walter Lee Davis <waltd-HQgmohHLjDZWk0Htik3J/w@public.gmane.org>:> > On Jan 13, 2011, at 12:36 PM, Donald R. Ziesig wrote: > > >I restrict the ip to 0.0.0.0 (localhost) so no one outside the > >server can use the route. If someone is able to hack into the > >server itself, all bets are off. :-( . So far I haven''t had any > >problems, and the site has been up for 3.5 years so far. > > > >local_request? would work too. > > > I need to do something similar -- keep all but cron requests from > the same server from tripping a particular method in my controller. > Can you elaborate on how local_request? could be used for that > purpose? I looked at the documentation, and it appears to be a test > you can run on an exception, but I''m not clear how to employ it -- > what would I use to raise the exception in the first place? > > Is it as simple as this? > > def my_api_method > send_out_a_bunch_of_mail if local_request? > end > > My gut tells me no, there''s an object missing here. >The object is an ActiveController instance, i.e. an HTTP request handler. The method checks the IP address of the requester. Jeffrey -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thank you guys! I''m using cron tasks like djangst sugested and it''s working well. And yes, I agree with Donald: plugins have this update problem... So I''ll try the Donald''s way as well. Big hug, Douglas Fonseca On 13 jan, 18:08, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote:> Quoting Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org>: > > > > > > > > > > > > > On Jan 13, 2011, at 12:36 PM, Donald R. Ziesig wrote: > > > >I restrict the ip to 0.0.0.0 (localhost) so no one outside the > > >server can use the route. If someone is able to hack into the > > >server itself, all bets are off. :-( . So far I haven''t had any > > >problems, and the site has been up for 3.5 years so far. > > > >local_request? would work too. > > > I need to do something similar -- keep all but cron requests from > > the same server from tripping a particular method in my controller. > > Can you elaborate on how local_request? could be used for that > > purpose? I looked at the documentation, and it appears to be a test > > you can run on an exception, but I''m not clear how to employ it -- > > what would I use to raise the exception in the first place? > > > Is it as simple as this? > > > def my_api_method > > send_out_a_bunch_of_mail if local_request? > > end > > > My gut tells me no, there''s an object missing here. > > The object is an ActiveController instance, i.e. an HTTP request handler. The > method checks the IP address of the requester. > > Jeffrey-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.