D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Debian apt-get upgrade and cron



On Sun, 15 Feb 2004 08:18:44 +0000
Neil Williams <linux@xxxxxxxxxxxxxx> wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I had the bright idea of letting cron manage the updates:
apt-get update works fine.
apt-get upgrade -y generates an error each time:

dpkg: `ldconfig' not found on PATH.
dpkg: `start-stop-daemon' not found on PATH.
dpkg: `install-info' not found on PATH.
dpkg: `update-rc.d' not found on PATH.
dpkg: 4 expected program(s) not found on PATH.
NB: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin.
E: Sub-process /usr/bin/dpkg returned an error code (2)

How can I get cron to use the same environment?
(Works fine when I su and run from bash)

The first two are in /sbin and the others are in /usr/sbin (on my debian box 
anyway). 

To the best of my knowledge cron doesn't get a full environment so you could 
consider either setting the environmental variables in the crontab (I think only 
supported by some versions of cron) or sticking the apt stuff in its own script 
which sets the vars first. Anyway, just a shot in the dark as I haven't meddled with 
cron for some time.

Good Luck

dave

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe.



Lynx friendly