Forum: Ruby on Rails once a day activity

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 Joe Van Dyk (Guest)
on 2006-05-26 04:54
(Received via mailing list)
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
Efe398b3b5436b0a8d4430090e8f86ea?d=identicon&s=25 seth b. (subimage)
on 2006-05-26 05:07
(Received via mailing list)
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/HowToPopul...

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
59de94a56fd2c198f33d9515d1c05961?d=identicon&s=25 Tom Mornini (Guest)
on 2006-05-26 18:11
(Received via mailing list)
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
Efe398b3b5436b0a8d4430090e8f86ea?d=identicon&s=25 seth b. (subimage)
on 2006-05-29 08:58
(Received via mailing list)
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.
This topic is locked and can not be replied to.