Say I want to send out an email once a day to people who''s name is "Bob". Would I use script/runner in conjunction with cron? Or is there another cool(er) way now? Thanks, Joe
I don''t like script/runner...Correct me if I''m wrong, but I don''t think you can pass in a file to runner. I just use a normal cron script, hooked up to rails that loads all the models I''ll need. I''ve been doing it this way since pre-script/runner: http://wiki.rubyonrails.com/rails/pages/HowToPopulateYourDbFromScript But there looks to be a better way of accomplishing it these days: http://wiki.rubyonrails.com/rails/pages/Environments#script http://jaxn.org/blog/archives/1753-cron-jobs-in-rails On 5/25/06, Joe Van Dyk <joevandyk@gmail.com> wrote:> > Say I want to send out an email once a day to people who''s name is "Bob". > > Would I use script/runner in conjunction with cron? Or is there > another cool(er) way now? > > Thanks, > Joe > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- seth at subimage interactive http://www.subimage.com/sublog/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060526/0cf1da6b/attachment.html
On May 25, 2006, at 8:04 PM, subimage interactive wrote:> I don''t like script/runner...Correct me if I''m wrong, but I don''t > think you can pass in a file to runner. I just use a normal cron > script, hooked up to rails that loads all the models I''ll need. > I''ve been doing it this way since pre-script/runner:Why the requirement to pass in a file? I create a class in lib/ and invoke a class method. script/runner -e production "Report.daily" for instance. This command *is* invoked by cron. The nice thing about this is that it''s *just Rails*. You don''t need to think about the environment for a moment. :-) -- -- Tom Mornini
I perform a lot of maintenance...on a few of my sites it requires massive data download / import / crunching of massive XML/CSV files. Couple that with old session cleanup, stats generation, etc & it''s a lot easier to maintain the code in one spot. I suppose for simple things the runner might be a nice way to go. On 5/26/06, Tom Mornini <tmornini@infomania.com> wrote:> > On May 25, 2006, at 8:04 PM, subimage interactive wrote: > > > I don''t like script/runner...Correct me if I''m wrong, but I don''t > > think you can pass in a file to runner. I just use a normal cron > > script, hooked up to rails that loads all the models I''ll need. > > I''ve been doing it this way since pre-script/runner: > > Why the requirement to pass in a file? > > I create a class in lib/ and invoke a class method. > > script/runner -e production "Report.daily" > > for instance. This command *is* invoked by cron. > > The nice thing about this is that it''s *just Rails*. > > You don''t need to think about the environment for > a moment. :-) > > -- > -- Tom Mornini > > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- seth at subimage interactive http://www.subimage.com/sublog/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060529/34b97faf/attachment.html