On Fri, 2003-06-13 at 12:30, Sean M Lentner wrote:
I have a script I use to check the state of machine, when I run it from the /jobtrig directory it runs fine as "root". When I add the entry to crontab as "root" using syntax crontab -e:
# DO NOT EDIT THIS FILE - edit the master and reinstall. # (/tmp/crontab.9682 installed on Wed May 21 22:19:53 2003) # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $) #minute hour mday month wday command 00 23 * * * cd /jobtrig && sh sweeper > sdtrace.log <-- word wrapping in Outlook
I get this in an email:
./sweep: sdsweep: command not found
But when I do an "ls" on the /jobtrig directory I see all the files:
drwxr-xr-x 2 0 0 128 May 21 22:19 . drwxr-xr-x 25 0 0 656 May 21 22:18 .. -rw-r--r-- 1 0 0 0 Jun 12 23:00 sdtrace.log -rwxr-xr-x 1 0 0 15 May 21 22:18 sweep -rwxr-xr-x 1 0 0 860 May 21 22:18 sweeper
I don't see sdsweep there
What am I doing wrong?
when you run things from crontab, by default they have a *very* limited $PATH. You could have a line in your crontab file like PATH=/usr/bin:/usr/local/bin:/path/to/my/commands or you could start your script with a line like that. Or you could give the absolute path to all commands you use in your script.