[CLUE-Tech] crontab not working

Bruce Ediger eballen1 at qwest.net
Wed Sep 25 13:44:26 MDT 2002


On 25 Sep 2002, Ski Dawg wrote:
> * * * * * /home/skidawg/bin/sigscript.sh
>
> (just to make sure) but that doesn't make a difference. If I just type
> /home/skidawg/bin/sigscript.sh at the command line, the script executes
> as expected.

I can't say if this is tripping you up, but I always have problems with
cron programs, and it's always for the same two reasons:

1. environment variables are very, very different from any user's shell
environment
2. sparse PATH, even relative to typical "root" PATH

I don't know how Red Hat does the default PATH, but my SuSE 8.0 box
has /etc/profile, comments in which say to set up /etc/profile.local
As an opposing example, Solaris 2.7 has a file named /etc/default/cron,
in which you can set environment values that all cron-spawned programs
get.  This sort of thing is really easy to set and forget you've ever
done it.

> I am pretty sure it has nothing to do with my script. I have
> successfully run this exact same script (through cron and command line)
> on a different Red Hat 7.3 machine and it worked correctly.

I'd go back to basics: make the contents of /home/skidawg/bin/sigscript.sh
an extremely simple sh script that prints out environment variables
using "printenv" or "env", calling whichever one you've got by a fully
qualified path.  Have it put the values in a file in /tmp:

/usr/bin/printenv > /tmp/sigscript.$$

Ensure that /home/skidawg/bin/sigscript.sh is actually marked executable,
and that the "#!" line isn't odd in some way, shape or form.

Double check that the PATH and other environment variables aren't screwing
up the real sigscript.sh code.




More information about the clue-tech mailing list