Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
Is your cron daemon running? Have you restarted lately? Should say: [12:33][root@server1:~]$ /etc/init.d/crond status crond (pid 22285) is running... –  Dave Drager Aug 26 '09 at 16:39
    
Cron problems should also show up in the root user's inbox. Anything there? –  Sean Staats Aug 26 '09 at 16:43
    
dave - yep, restarted very recently and ps shows crond is running sean - no mail for root thanks! –  Kyle Aug 26 '09 at 16:48
    
Try sneaking in there with strace -p <Cron PID> and see what is going on. –  Dave Drager Aug 26 '09 at 16:52
    
good sleuthing! –  Andy Aug 27 '09 at 7:02

3 Answers 3

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?

share|improve this answer
    
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

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.

share|improve this answer
    
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
up vote 0 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.