Forum: Ruby on Rails scheduled processes

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.
4098ef08ed2ee3eabeb0ddf0ec03f783?d=identicon&s=25 railsonly (Guest)
on 2005-11-30 22:51
(Received via mailing list)
How in Rails do you set up a scheduled process, i.e. something that for
example periodically sends out an email to the site's users.  Is this
possible?
5cfd7e9223637ea26c81c2cc3e43799e?d=identicon&s=25 craig (Guest)
on 2005-11-30 23:24
(Received via mailing list)
On 30 Nov 2005, at 21:47, Frank Kim wrote:
> How in Rails do you set up a scheduled process, i.e. something that
> for example periodically sends out an email to the site's users.
> Is this possible?

I'd do this by having a scheduled job visit your mail controller and
call a send_email action at a regular interval. Make sure you
authenticate the job -- check IP addresses etc -- so that people
can't cause your app to send email by visiting the wrong URI.

Yours,
Craig
--
Craig Webster | t: +44 (0)131 516 8595 | e: craig@xeriom.net
Xeriom.NET    | f: +44 (0)709 287 1902 | w: http://xeriom.net
4098ef08ed2ee3eabeb0ddf0ec03f783?d=identicon&s=25 railsonly (Guest)
on 2005-12-01 02:17
(Received via mailing list)
Hi Craig,
I am guessing you mean that the scheduled job is created outside of
rails,
whether it be a wget in a cron job or something like that, instead of
within
rails, right?
-Frank
2ccb2f7699267d258faaafce4ee997df?d=identicon&s=25 codyfauser (Guest)
on 2005-12-01 02:50
(Received via mailing list)
Frank,

Take a look at this page on the wiki:
http://wiki.rubyonrails.com/rails/pages/HowToRunBa...


Cody

On 11/30/05, Frank Kim <railsonly@gmail.com> wrote:
> > > How in Rails do you set up a scheduled process, i.e. something that
> > --
>
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>


--
http://www.codyfauser.com
4098ef08ed2ee3eabeb0ddf0ec03f783?d=identicon&s=25 railsonly (Guest)
on 2005-12-01 03:06
(Received via mailing list)
Thanks.  Based on that page it looks like the best answer for now is to
use
cron with wget, not the most satisfying answer.
A78fabe22aa7df17f05cb02e622e20a7?d=identicon&s=25 jerrett (Guest)
on 2005-12-01 03:14
(Received via mailing list)
on an app I had to do something along these lines i created a cron dir
off the project root, and just created a .rb script and added it to my
cron.. add the following to the top to work within your environment/app:

#!/usr/bin/ruby
ENV['RAILS_ENV'] = 'production'
require File.dirname(__FILE__) + '/../config/environment'
2ccb2f7699267d258faaafce4ee997df?d=identicon&s=25 codyfauser (Guest)
on 2005-12-01 04:59
(Received via mailing list)
Frank,

You can't use script/runner with cron? Its usage should be described
on that same page.


Cody


On 11/30/05, Jerrett Taylor <jerrett@bravenet.com> wrote:
>
> > > Hi Craig,
> > > > > for example periodically sends out an email to the site's users.
> > > > Craig Webster | t: +44 (0)131 516 8595 | e: craig@xeriom.net
> > >
> > http://www.codyfauser.com
> > _______________________________________________
> > Rails mailing list
> > Rails@lists.rubyonrails.org
> > http://lists.rubyonrails.org/mailman/listinfo/rails
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
http://www.codyfauser.com
This topic is locked and can not be replied to.