> > nine:/home/roger # crontab -l
> > 0 20 * * * shutdown -h -t secs 1
> 
> Use an absolute path for shutdown, e.g. /sbin/shutdown.  Jobs run by cron(8)
> have a restricted path which is often just /bin and /usr/bin.  The man page
> for crontab(5) on your system has a bit more detail.

Yes. On my system, the environment used by cron is copied into the
headers of the mails sent by cron.

PATH is set for programs run by cron in /etc/crontab, though that file
is best never touched (place your tabs into /etc/cron.d/ instead). You
can use the same method to set PATH in any of your tab files, which is
probably better, but keep it to system directories. As soon as you call
scripts from cron you're likely to find that half the stuff called from
the script is absent, so calling the script with an absolute path isn't
going to do much good.

Volker

PS That shutdown command is bogus too, even if it was found by cron,
cron would just email you a barf.

-- 
Volker Kuhlmann                 is list0570 with the domain in header
http://volker.dnsalias.net/     Please do not CC list postings to me.

Reply via email to