If you set up a rake task in lib/tasks/your_cron_job.rake with
something like this
namespace :your_cron_job do
desc "describe the task"
task :every_five_minutes => :environment do
@post = Post.new
you can add it manually to the cron by typing 'crontab -e' which opens
the file for editing (*nix only)
first specify how often you want the job to run... in this case every
5 minutes "*/5 * * * *" along with correct paths to app and rake, set
the RAILS_ENV and task name to execute. Cron is just a file so you'll
enter all the info for the job on one line like so... (if you don't
have a default editor set up already it will prompt you to do so
before entering in this command).
*/5 * * * * cd /var/www/my_ror_application && /usr/bin/rake
More info here http://seanbehan.com/programming/set-cron-job-to-run-every-five-minutes-for-a-ruby-on-rails-rake-task/
There are more elegant approaches to this problem. This is just the
quick and dirty.