On Jun 9, 2007, at 5:13 AM, mike wrote:
> > Hi, i've a little problem. i've to run a method every 5 minutes with > cron, but i don't know what and where i've to write it. The method is > written, but to run it ? i know that i've to use the script/runner > (does > it take a lot of resources? does exist something better?), but to > run it > every 5 minutes? > * 5 * * * script/runner -e production "Class.method" ? > and in which file should i put it ? (i'm under gentoo with vixie-cron) > Thanks > > I'd create a shell script on your server(s) to do this. edit ~/scheduled-tasks/my-scheduled-task-name ########## #!/bin/sh # change directory export RAILS_ENV=production cd ~/path/to/rails/app ruby scipt/runner "Class.method" ######### chmod +x ~/scheduled-tasks/my-scheduled-task-name crontab entry: * 5 * * * $HOME/scheduled-tasks/my-scheduled-task-name Something along those lines should work. Robby -- Robby Russell Founder and Executive Director PLANET ARGON, LLC Ruby on Rails Development, Consulting & Hosting www.planetargon.com www.robbyonrails.com +1 503 445 2457 +1 877 55 ARGON [toll free] +1 815 642 4068 [fax] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Deploying Rails" group. To post to this group, send email to rubyonrails-deployment@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-deployment?hl=en -~----------~----~----~----~------~----~------~--~---