schedule to run a method?

Hi, everyone. I wrote a ror app. One of the methods in controller extracts data from files and saves it to database. Because there are many new files every night, is it possible to run this method only every night or every other night? Thanks in advance.

Quoting Ichiro Saga <lists@ruby-forum.com>:

Hi, everyone. I wrote a ror app. One of the methods in controller extracts data from files and saves it to database. Because there are many new files every night, is it possible to run this method only every night or every other night? Thanks in advance.

Simplest way in Linux/Unix/MacOSX is with cron and 'script/runner Class.class_method' or something similar. Probably best to run it as same user as the Rails server to avoid permission problems. There are other ways that may be more appropriate in some cases. If you care to share more details I could recommend an ever better method.

Jeffrey