here's what I've loaded into root's crontab:

==========================================

# min, hr, date
50 10 * * * ntpdate -s time-nw.nist.gov
#

==========================================

this is the mail I receive from the failed cron job...

==========================================

>From root  Sat Jun  8 10:50:00 2002
Date: Sat, 8 Jun 2002 10:50:00 -0600
From: [EMAIL PROTECTED] (Cron Daemon)
To: [EMAIL PROTECTED]
Subject: Cron <root@marge> ntpdate -s time-nw.nist.gov
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>

/bin/sh: ntpdate: command not found

==========================================

the problem (well, it's not really a problem; I could just call it
/usr/sbin/ntpdate) is that I want to be able to set the PATH to whatever it
is for root user...

thanks for your help,

Kevin

Michael Fratoni wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Saturday 08 June 2002 12:14 pm, Kevin Weslowski wrote:
> > Hello,
> >
> > I noticed that my Redhat 7.1 cron environment isn't working as I
> > expected...I was hoping someone could help me configure it...
> >
> > I found this out because it seems like when cron runs (for root) it
> > doesn't use the environment variables specified in /etc/crontab.  My
> > shell
> > in /etc/crontab is set to /bin/bash but when I get an email back from a
> > cron job, it shows:
> >
> > X-Cron-Env: <SHELL=/bin/sh>
>
> Please press enter every 72 characters or so, or set you mail client to
> wrap properly.
>
> I don't know where cron is picking up /bin/sh, however it shouldn't hurt
> anything. /bin/sh should be a symbolic link to /bin/bash.
>
> $ ll /bin/sh
> lrwxrwxrwx    1 root     root            4 May 12 19:09 /bin/sh -> bash
>
> Have you specified the user to run the cron job as in /etc/crontab?
> Like so:
> 01 * * * * root run-parts /etc/cron.hourly
>
> I'm not sure how cron behaves if the user isn't set when executing from
> /etc/crontab.
>
> What are the remaining cron environmental variables shown in the message?
> For example:
> X-Cron-Env: <SHELL=/bin/bash>
> X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
> X-Cron-Env: <MAILTO=root>
> X-Cron-Env: <HOME=/>
> X-Cron-Env: <LOGNAME=root>
>
> - --
> - -Michael
>
> pgp key:  http://www.tuxfan.homeip.net:8080/gpgkey.txt
> Red Hat Linux 7.2 in 8M of RAM: http://www.rule-project.org/
> - --
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: For info see http://www.gnupg.org
>
> iEYEARECAAYFAj0CNCwACgkQn/07WoAb/StaSQCdFjIGQxXKNdMaF8bq5MJCpAb1
> l30AnjdYCQ1pSbvfSA8pknQgA0ZfmScT
> =8RmK
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Seawolf-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/seawolf-list



_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list

Reply via email to