Lars Haugseth
2/2/2009 9:36:00 PM
* Andrew Timberlake <andrew@andrewtimberlake.com> wrote:
>
> On Sat, Jan 31, 2009 at 8:55 AM, Vikas Gholap <vikasg@aflatune.com> wrote:
>
> > how i execute the ruby program on unix's cron job utility.?
>
> If you're working with rails, you could write a rake task and call that from
> cron or just run a ruby script directly like:
> * * * * * /usr/bin/ruby /path/to/your/ruby/script.rb
If you're running a Rake task, most of these will expect the root of your
Rails project to be the current directory. Unless running in development
you will also want to specify the environment:
m h * * * (cd /path/to/project; RAILS_ENV=production /usr/bin/rake my:task)
--
Lars Haugseth
"If anyone disagrees with anything I say, I am quite prepared not only to
retract it, but also to deny under oath that I ever said it." -Tom Lehrer