# Rails time triggered actions

**URL:** <https://www.ruby-forum.com/t/rails-time-triggered-actions/172131>\
**Category:** Rails\
**Created:** [July 15, 2009, 10:29am UTC](https://www.ruby-forum.com/t/rails-time-triggered-actions/172131 "2009-07-15T10:29:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![enzor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@enzor](https://www.ruby-forum.com/u/enzor)\
**Post date:** [July 15, 2009, 10:29am UTC](https://www.ruby-forum.com/t/rails-time-triggered-actions/172131/1 "2009-07-15T10:29:38Z")

</div>

Is there a way to make some method to act on a specific time?

Right now, i managed to bypass this problem by attaching this method to  
the login factor of the site (everytime an admin log in the site, also  
this method is called) , but there is a more direct and time related  
way?

---

<div class="post-metadata">

**Author:** ![enzor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@enzor](https://www.ruby-forum.com/u/enzor)\
**Post date:** [July 15, 2009, 11:37am UTC](https://www.ruby-forum.com/t/rails-time-triggered-actions/172131/2 "2009-07-15T11:37:34Z")

</div>

Enzo R. wrote:

> Is there a way to make some method to act on a specific time?
> 
> Right now, i managed to bypass this problem by attaching this method to  
> the login factor of the site (everytime an admin log in the site, also  
> this method is called) , but there is a more direct and time related  
> way?

If you’re on a \*NIX system your should use cron to run a standalone  
program. Start it with script/runner to gain access to all the models  
defined by your Rails application. If you just need to call a URL, use  
cron to run a wget to that URL.

Windows has it’s own scheduled tasks systems so you should be able to  
solve your problems there as well.

---

<div class="post-metadata">

**Author:** ![enzor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@enzor](https://www.ruby-forum.com/u/enzor)\
**Post date:** [July 15, 2009, 1:47pm UTC](https://www.ruby-forum.com/t/rails-time-triggered-actions/172131/3 "2009-07-15T13:47:11Z")

</div>

Take a look at Rufus Scheduler ([http://rufus.rubyforge.org/rufus-](http://rufus.rubyforge.org/rufus-)  
scheduler/) is working great for me, and is not plataform dependent.

Regards.

Franco C…

On Jul 15, 5:29 am, Enzo R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![enzor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/bbe5ce/32.png) [@enzor](https://www.ruby-forum.com/u/enzor)\
**Post date:** [July 15, 2009, 2:03pm UTC](https://www.ruby-forum.com/t/rails-time-triggered-actions/172131/4 "2009-07-15T14:03:40Z")

</div>

thanks a lot 😉
