# Suggestions on automation?

**URL:** <https://www.ruby-forum.com/t/suggestions-on-automation/50271>\
**Category:** Rails\
**Created:** [November 26, 2005, 6:47pm UTC](https://www.ruby-forum.com/t/suggestions-on-automation/50271 "2005-11-26T18:47:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonlee9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jasonlee9](https://www.ruby-forum.com/u/jasonlee9)\
**Post date:** [November 26, 2005, 6:47pm UTC](https://www.ruby-forum.com/t/suggestions-on-automation/50271/1 "2005-11-26T18:47:15Z")

</div>

Hi all,

In continuing with my port from Java to Rails I wanted to ask what  
people are using for automated tasks. In our current app we have a  
standalone server that pulls RSS feeds everyday and converts them to  
the appropriate content types on our system and then another task  
fires which goes thru these content types and generates an automated  
email message notifying users of any matches for the day.

Currently we’re using Spring and Hibernate with Spring’s Quartz timer  
functionality. I could easily move the firing of the processes  
themselves to the appropriate cron jobs (which I’ll prob do), but I’d  
still like to use AR and whatever else of Rails is necessary to read/  
write from the db. Does anyone have a preferred way of doing this so  
that I can call a Ruby file and have it use all my existing code and  
support from Rails?

Thanks,

- jason

---

<div class="post-metadata">

**Author:** ![jasonlee9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jasonlee9](https://www.ruby-forum.com/u/jasonlee9)\
**Post date:** [November 26, 2005, 7:19pm UTC](https://www.ruby-forum.com/t/suggestions-on-automation/50271/2 "2005-11-26T19:19:36Z")

</div>

On Saturday 26 November 2005 17:44, Jason L. wrote:

> functionality. I could easily move the firing of the processes  
> themselves to the appropriate cron jobs (which I’ll prob do), but I’d  
> still like to use AR and whatever else of Rails is necessary to read/  
> write from the db. Does anyone have a preferred way of doing this so  
> that I can call a Ruby file and have it use all my existing code and  
> support from Rails?

Why not write a little Ruby daemon which uses ActiveRecord? You  
can use AR outside of Rails. If you don’t like that idea you could  
put the work into a action which you ‘call’ by requesting it  
when you want the tasks to be performed. You just need to make  
your models available to the daemon script.

I have lots of little Ruby daemons which use AR for all sorts  
of things.

> Thanks,
> 
> - jason
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

HTH,

---

<div class="post-metadata">

**Author:** ![jasonlee9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jasonlee9](https://www.ruby-forum.com/u/jasonlee9)\
**Post date:** [November 26, 2005, 7:27pm UTC](https://www.ruby-forum.com/t/suggestions-on-automation/50271/3 "2005-11-26T19:27:39Z")

</div>

[http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails/versions/1](http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails/versions/1)

---

<div class="post-metadata">

**Author:** ![jasonlee9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jasonlee9](https://www.ruby-forum.com/u/jasonlee9)\
**Post date:** [November 26, 2005, 7:39pm UTC](https://www.ruby-forum.com/t/suggestions-on-automation/50271/4 "2005-11-26T19:39:46Z")

</div>

Hi,

yes, I saw this. However, I’m not really looking to run jobs in the  
background or to fork functionality during a webapp. I’m actually  
looking to run jobs on a separate machine (altho, the machine is not  
really the issue) and to actually include my Rails code into the task  
I’m doing. So like cron -\> MyTask.rb -\> use existing AR objects.  
Thanks tho, I’ll keep looking.

-jason

---

<div class="post-metadata">

**Author:** ![jasonlee9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jasonlee9](https://www.ruby-forum.com/u/jasonlee9)\
**Post date:** [November 26, 2005, 8:04pm UTC](https://www.ruby-forum.com/t/suggestions-on-automation/50271/5 "2005-11-26T20:04:11Z")

</div>

Yes, if you really the page closely, it describes just that (plus some  
more)  
(hint: script/runner)

---

<div class="post-metadata">

**Author:** ![jasonlee9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jasonlee9](https://www.ruby-forum.com/u/jasonlee9)\
**Post date:** [November 26, 2005, 7:27pm UTC](https://www.ruby-forum.com/t/suggestions-on-automation/50271/6 "2005-11-26T19:27:40Z")

</div>

This may answers your question:

[http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails](http://wiki.rubyonrails.org/rails/pages/HowToRunBackgroundJobsInRails)

---

<div class="post-metadata">

**Author:** ![jasonlee9](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/4491bb/32.png) [@jasonlee9](https://www.ruby-forum.com/u/jasonlee9)\
**Post date:** [November 26, 2005, 8:56pm UTC](https://www.ruby-forum.com/t/suggestions-on-automation/50271/7 "2005-11-26T20:56:34Z")

</div>

Ok, I’ll re-read it again, but more carefully this time. 😉 thx.
