Daily Routine

Hi guys,

I was wondering if sb could guide me.

I want to create a thread that was started with rails server start up. This Thread does some database update every day (automatically).

Sb knows where can I find some materials about it?

Thx

Bruno Meira

Hi guys, I was wondering if sb could guide me.

"sb" ?

I want to create a thread that was started with rails server start up. This Thread does some database update every day (automatically). Sb knows where can I find some materials about it?

It would be impossible to suggest anything without knowing more about your environment (at least, which OS). For instance, you might achieve what you want with cron, or scheduled tasks.

sb = somebody (Sorry, English is not my native language ;/ )

Well, I’m using Debian.

I want to run this task at the end of the day(This day could be given by the time in my server). This task will do some updates in my database.

I would use cron to run a script.

Michael, It seems that this RailsCron gem is what I’ve been looking for. :smiley: I will take a look in it.

Thx :smiley:

Really? If you insist. But it seems like overkill to add scheduling to your application for the requirement you described. But that's a decision that only you can make.

TTFN

I will try using this gem, If it not works properly or overload my application I will try using another approach.

Thx a lot, Before your answers I didn’t know how could I start doing this activity.

:smiley:

That way the crons can also be maintained when you use capistrano and they will be deployed to new machines if needed. It makes a great deal of sense to bundle the application specific crons with he application itself.

Also, check out [whenever](https://github.com/javan/whenever)

You also might want to have a look at the Whenever gem it provides neat syntax all done with ruby and integrates well with capistrano.

https://github.com/javan/whenever

Hope this helps!

+1 to “whenever” gem for the exact reasons benjamin points out.

Gautam Pai

Hmmm Thx… I will take a look in this whenever. It’s seems easy to use. :smiley: