Scheduled processes

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?

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: [email protected]
Xeriom.NET | f: +44 (0)709 287 1902 | w: http://xeriom.net

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

Thanks. Based on that page it looks like the best answer for now is to
use
cron with wget, not the most satisfying answer.

Frank,

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

Cody

On 11/30/05, Frank K. [email protected] wrote:

How in Rails do you set up a scheduled process, i.e. something that


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


http://www.codyfauser.com

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’

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. [email protected] wrote:

Hi Craig,

for example periodically sends out an email to the site’s users.
Craig W. | t: +44 (0)131 516 8595 | e: [email protected]

http://www.codyfauser.com


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


http://www.codyfauser.com