ara.t.howard / noaa.gov wrote:
> On Wed, 7 Jun 2006, Hunter Walker wrote:
>
>> I want to run a particular script every 3 minutes.  I would do this
>> using crontab in Linux, but I am having trouble getting that to work.
>> The script works fine from the Windows or Linux command line, however.
>>
>> I thought it might be easier to add some code to the end of the script
>> that tells it to sleep for three mins and then start at the beginning.
>>
>> Any thoughts?  As always, I appreciate your help.
>>
>> -Hunter
>>
>> -- 
>> Posted via http://www.ruby-forum.com/.
>
>
> sleep 180
> exec ["ruby" + ARGV].join(' ')
>
> -a
In practice I would say this is a bad idea.  What if you start this on a 
server and forget about it?  Then, some day down the road, the process 
starts failing for whatever reason, and some poor admin is left 
wondering whether or not it's safe to kill the process.  Call me paranoid.

Better to figure out why it's failing under cron.  The most likely 
causes, in my experience, tend to be environment variable issues and bad 
assumptions about what Dir.pwd is.

Regards,

Dan