[expert] urpmi doesn't run from script

2001-11-12 Thread bascule
i have a little script that i run every now and then as follows: #!/bin/bash #this runs rsync to update the local copy of cooker rsync -avL --delete --delete-after fr2.rpmfind.net::linux/Mandrake-devel/cooker/i586/ /mandrake/cooker/ > /dev/null 2> /dev/null #this updates urpmi database urpmi.up

Re: [expert] urpmi doesn't run from script

2001-11-12 Thread Peter Watson
On Monday 12 November 2001 20:59 pm, bascule wrote: > i have a little script that i run every now and then as follows: > > #!/bin/bash > #this runs rsync to update the local copy of cooker > rsync -avL --delete --delete-after > fr2.rpmfind.net::linux/Mandrake-devel/cooker/i586/ > /mandrake/cooker/

Re: [expert] urpmi doesn't run from script

2001-11-13 Thread bascule
i did try exec, as far as i can tell from 'man bash' i just stick it at the beginning of the line right? not that i really understand the difference with using it, anyway there was still no sign of urpmi updating my local cooker source, it's not a huge deal since i can do it manually but a bit

Re: [expert] urpmi doesn't run from script

2001-11-14 Thread bascule
further to this i have discovered the following: the following script will work when run from a console su'ed to root: #!/bin/bash urpmi.update localcooker so will the following: #!/bin/bash urpmi.update localcooker > /dev/null 2> /dev/null neither, when invoked ising alt-f2 and kdesu, will run,

Re: [expert] urpmi doesn't run from script

2001-11-14 Thread Bill Kenworthy
Try su - -c 'command' Normal su (and kdesu I think) inherit the current user environment, the dash tells it to spawn a new one based on root. There are differences in the default path etc when running programs in this way which can cause obscure failures. BillK On Thu, 2001-11-15 at 07:27, ba

Re: [expert] urpmi doesn't run from script

2001-11-14 Thread bascule
thanks, i sort of see what you mean, this might explian why kdesu doesn't do it, though #su #./somescript does work without the dash, unfortunately, it's not a reason that might explain why a cron job run as root (setup with webmin) that calls the script would fail, would it? i have wondered

Re: [expert] urpmi doesn't run from script

2001-11-14 Thread William Kenworthy
You can use the dash with kdesu as well I think. Also, do some reading "man cron" and I think you will find that cron actually uses a particular restricted environment, hence your errors. I have got around this in the past by putting the job in a script file that sets the environment and which i

Re: [expert] urpmi doesn't run from script

2001-11-14 Thread bascule
from man cron and man 5 crontab it seems that only SHELL, LOGNAME and HOME are set, since the script itself can specify a shell? i assume there is some additional environment variable that is set in a console that affects the running of urpmi, thanks for the pointer bascule On Thursday 15 Nov

Re: [expert] urpmi doesn't run from script

2001-11-14 Thread bascule
further to my previous reply, i tried adding the following to my little script: ENV=~/.bashrc export ENV then i tried ENV=/etc/bashrc export ENV but in the end adding the following which are part of /root/.bashrc: PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin