Centos – cron not running on centos 5.2

centoscronruby

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

Best Answer

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?

Related Topic