If you need to perform some action at particular time then you should
test is is a time to action.
If time is right, do you thing.
If not then sleep a while and then test it once again.

You can have an initial sleeping interval and then you can adjust in
correlation how far is the next running time.

What issues you have with backgroundrb (http://
backgroundrb.rubyforge.org/scheduling/)?



On Dec 22, 11:00 pm, Mark Mr <rails-mailing-l...@andreas-s.net> wrote:
> Does anyone know how to do cron-like scheduling with the daemon gem?
> basically i need my script to execute every day at 4 a.m. Here's what
> the default files comes with
>
> while($running) do
>
>   # Replace this with your code
>   ActiveRecord::Base.logger.info "This daemon is still running at
> #{Time.now}.\n"
>
>   sleep 10
> end
>
> I just need a way to substitute "sleep 10" with "runs every day at 4
> a.m." I really looked around but cant seem to find the answer. Btw i
> tried backgroundrb but I was having problems with it so i'm trying to
> just do it with daemons. Any help would be greatly appreciated.
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to