[vox-tech] Problem with crond?

Richard S. Crawford rscrawford at mossroot.com
Wed Sep 29 15:09:07 PDT 2004


Ken Herron said:
> --On Wednesday, September 29, 2004 12:44:24 -0700 "Richard S. Crawford"
> <rscrawford at mossroot.com> wrote:
>
>> I'm trying to get a wget command to execute every five minutes.
>> crontab -e looks like this:
>>
>> */5 * * * * wget -q -O /dev/null http://152.79.198.89/moodle/cron.php
>>
>> Running the wget command from the command line performs the action
>> properly, but it doesn't seem to be happening every five minutes as
>> it's supposed to.  I've double checked my crontab command and verified
>> that crond is running (with ps) but it doesn't seem to be working.
>
> Cron should log every command that it runs through syslog. First thing
> would be to see if cron is actually launching the command on schedule or
>  not.

According to the system log, the command is indeed being run every five
minutes.  The PHP script itself is supposed to send out email; when I
browse to the page using Lynx or Wget or Firefox, the script runs properly
and I see the results in the maillog.


> In my experience, the usual reason that commands work interactively but
> not from cron is that they depend on something in your interactive
> environment. Perhaps wget isn't in the PATH that cron uses, or it
> requires some environment variable to be set?

Well, I've now included the full path to wget -- /usr/bin/wget -- but that
doesn't seem to have done it.  I can't find any documentation about
environment variables that wget might need, and no indication that it's
failing in the system logs.

Argh!




More information about the vox-tech mailing list