1

Sorry if this is a dupe - after I merged my Stackoverflow and serverfault accounts, my question seemingly was erased...

Using CentOS 5.2 and this cron is not running at all (/var/log/cron is not showing any activity, and feat.log is empty).

5 0 * * * /opt/ree/bin/ruby /srv/corkd/current/script/runner --environment=staging 'Featurable.shift' > /home/kyle/feat.log 2>&1

update: all of a sudden it's running - */5 * * * * [command] somehow runs, but 5 0 * * * [command] won't run (or any single minute, single hour setup)... and strace shows perfect operation as well...

update 2: the server I thought was located on the east coast, and set to eastern time, is in fact 3 timezones away. So my crontab was technically correct, but needed the hour bumped back 3 hours... amazing. date would have solved everything

Kyle
  • 141
  • 1
  • 7

3 Answers3

1

Just to be sure, have you tried running the command in a shell?

It could be something in the cron's shell config preventing ruby running. Verify your /etc/crontab looks similar to this (if you haven't customised it, this is RHEL default):

    [andy@]# cat /etc/crontab
    SHELL=/bin/bash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    MAILTO=root
    HOME=/

    # run-parts
    01 * * * * root run-parts /etc/cron.hourly
    02 4 * * * root run-parts /etc/cron.daily
    22 4 * * 0 root run-parts /etc/cron.weekly
    42 4 1 * * root run-parts /etc/cron.monthly

You can also change your crontab to /5 * * * * to run the task every 5 minutes while testing (if plausible).

Do you have any other crons running atm?

Andy
  • 5,230
  • 1
  • 24
  • 34
  • yep, runs perfectly from shell, and /etc/crontab is unmodified. no other crons, and i have it set up to run /5 to test... – Kyle Aug 26 '09 at 17:10
  • you might try another simple cron such as echo "test" > /tmp/testcron.txt to verify the daemon? – Andy Aug 26 '09 at 17:37
0

Maybe u should check if this will work:

5 0 * * * USER /opt/ree/bin/ruby /srv/corkd/current/script/runner --environment=staging 'Featurable.shift' > /home/kyle/feat.log 2>&1

change USER for user u want to use for this job and run cron. I have such problem ones and that solves my problem.

waltharius
  • 66
  • 2
  • thanks. it turns out to be a dumb error on my part - see Update #2 in the original question – Kyle Aug 31 '09 at 22:22
0

Turns out the server I thought was located on the east coast, and set to eastern time, is in fact 3 timezones away. So my crontab was technically correct, but needed the hour bumped back 3 hours... amazing. date would have solved everything.

Kyle
  • 141
  • 1
  • 7