Hi .. 

 On Friday 18 March 2005 06:24, andreas.cahen / gmail.com wrote:
> Hi!
>
> I am using two Ruby scripts on my *inux server to purge old records out
> of a mysql database. These two scripts run, or should, as cronjobs. If
> I start those scripts directly from the shell it all works fine. But as
> a cronjob I get the following error:
>
My experience with root cronjobs and ruby says that you should explicitly 
define everything.  For example, one script, an automated collection agent, 
goes like this:

  $ cat cron_collect
  #! /usr/bin/ksh
  cd /usr/local/share/collect
  /usr/local/share/collect/bin/collect.rb -n input.yaml

Where 'collect.rb' is a Ruby script with the shebang line

 #! /usr/local/bin/ruby

and 'input.yaml' is in /usr/loca/share/collect

The crontab entry looks like

  30 0-23 * * * /usr/local/share/collect/cron_collect

The shebang line for the executing shell is also important.  On a linux box, 
using /usr/bin/bash would probably be better.

I hope that this helps.

Regards,

-- 
-mark.  (probertm at acm dot org)