Cron and runner doesn't work anymore?

Hello,

For a number of projects I have, I use the runner and a cron job to run maintenance code every so often. I noticed since I updated to rails 1.1.6, none of my cron jobs get executed anymore. I know that the code still works because if I type in the line in the cron tab manually it runs and I also checked the cron logs and made sure that the runner script is called. My runner cron jobs just stopped working on 3 of my servers after the 1.1.6 update.

To test, I setup a small application, here is my run class:

class Run

   def self.test
     puts "Hello World"
   end

end

Here is the line in my crontab:

* * * * * ruby /Users/carllerche/Developer/Ruby/test_themes/script/runner "Run.test" >> /Users/carllerche/run.log

yet nothing happens at all. Does anybody know what's going on?

Thanks,
-carl

Carl,

There was a thread not unlike this one yesterday. Might it be the same issue?

Hello,

For a number of projects I have, I use the runner and a cron job to
run maintenance code every so often. I noticed since I updated to
rails 1.1.6, none of my cron jobs get executed anymore. I know that
the code still works because if I type in the line in the cron tab
manually it runs and I also checked the cron logs and made sure that
the runner script is called. My runner cron jobs just stopped working
on 3 of my servers after the 1.1.6 update.

To test, I setup a small application, here is my run class:

class Run

  def self.test
    puts "Hello World"
  end

end

Here is the line in my crontab:

* * * * * ruby /Users/carllerche/Developer/Ruby/test_themes/script/
runner "Run.test" >> /Users/carllerche/run.log

yet nothing happens at all. Does anybody know what's going on?

Compare your environment variables from your shell to what cron has. Odds are cron is missing something that rails wants (and perhaps used to figure out on it's own or something).

What does your #{RAILS_ENV}.log say? anything?

Compare your environment variables from your shell to what cron has. Odds
are cron is missing something that rails wants (and perhaps used to figure
out on it's own or something).

What does your #{RAILS_ENV}.log say? anything?

My #{RAILS_ENV}.log is completely empty. Which environment variables should I compare and how should I do it?

Another thing to note is that my cron jobs WERE running fine, then they just died all of a sudden and I believe that coincides with when I updated to 1.1.6

-carl

'Cron w/Rails' is the title. The gist is to get cron to the point where it's emailing you (or is otherwise giving you something you can read) and then have it run

which ruby

and give you the results. Then compare that output with the output you get by running the same command at the prompt. Did you happen to modify ruby in any way around the same time that you upgraded Rails?

I found the thread and it seems that it fixed it (was the path deal).
Thanks for the tip!

-carl