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.
railsonly (Guest)
on 2005-11-30 23: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?
craig (Guest)
on 2005-12-01 00:24
(Received via mailing list)
On 30 Nov 2005, at 21:47, Frank K. 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 W. | t: +44 (0)131 516 8595 | e: removed_email_address@domain.invalid
Xeriom.NET    | f: +44 (0)709 287 1902 | w: http://xeriom.net
railsonly (Guest)
on 2005-12-01 03: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
codyfauser (Guest)
on 2005-12-01 03: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 K. <removed_email_address@domain.invalid> wrote:
> > > How in Rails do you set up a scheduled process, i.e. something that
> > --
>
>
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>


--
http://www.codyfauser.com
railsonly (Guest)
on 2005-12-01 04: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.
jerrett (Guest)
on 2005-12-01 04: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'
codyfauser (Guest)
on 2005-12-01 05: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 T. <removed_email_address@domain.invalid> wrote:
>
> > > Hi Craig,
> > > > > for example periodically sends out an email to the site's users.
> > > > Craig W. | t: +44 (0)131 516 8595 | e: removed_email_address@domain.invalid
> > >
> > http://www.codyfauser.com
> > _______________________________________________
> > Rails mailing list
> > removed_email_address@domain.invalid
> > http://lists.rubyonrails.org/mailman/listinfo/rails
>
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


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