Try putting in the script:

DISPLAY=:0.0

at the top after #!/bin/sh

HTH,
Bill


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of German Guillot
> Sent: Wednesday, August 04, 2004 4:43 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [newbie] Cron doesn't run for user
>
>
> On Wed, 04 Aug 2004 15:07:43 -0500, Mikkel L. Ellertson
> <[EMAIL PROTECTED]> wrote:
>
> > > Yep, I did that. I tried PATH=/home/ger/bin and when that didn't work
> > >  PATH=/bin:/usr/bin:/usr/bin/X11: etc, the whole bash environment
> > > variable.
> > >
> > Did you add the full path in the script, or in the crontab entry?
>
> I added it only in the crontab entry, both in the PATH variable and in
> the line to be executed.
>
> > I find specifing the path the script expects in the script itself cuts way
> > down on problems, especialy if you later change your path from what it
> > was when you wrote the script.  You can usualy depend on /bin;/usr/sbin,
> > but anything else depends on how the script is being run.
>
> Hm. With a script such as:
>
> #!/bin/bash
> cat  /home/ger/test.1 >> /home/ger/test.2
>
> you mean I should write:
>
> #!/bin/bash
> /bin/cat  /home/ger/test.1 >> /home/ger/test.2
>
> right? Well, darn it, yes! I just tried it (that very example with
> cat, which was not working either) and now it works.  That was really
> mystifying me, because I reckoned cat should always work. Of course it
> does.
>
>
> > > Just to see, I made another script to open a browser window. All it
> > > has is this:
> > >
> > > #!/bin/bash galeon
> > >
> > > It's called /home/ger/bin/gal and works from the command line. But
> > > not from cron. Those things you point out might be the reason... I'll
> > > use a command that always works and check it. Any suggestions?
> > >
> > I bet it will not work from the command line if you are at the command
> > line interface, instead of the command line in an xterm.  Any command
> > that needs X to run will NOT work in a cron job.  This is because it can
> > not connect to an X server - at least not with the default security
> > settings.  It is not a good idea to change the settings to allow this,
> > unless you are on an isulated machine.  (I remember playing tricks on
> > people running an open X server...)  ;)
>
> Right again! :) If I try to run my little "program" gal from a login
> shell and not an xterm, I get and error message:
>
> [EMAIL PROTECTED] ger]$ gal
> (galeon-bin: 13165): Gtk-WARNING **: cannot open display:
>
>
> > I hope this helps...
>
> It does indeed, thank you. All the mysteries have been explained. I
> still can't do what I was trying to do, but now I know why. It was
> only to learn, so I can count the whole thing a success after all.
>
> Thank you again.
>
> Germán.
>
>


____________________________________________________
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com
____________________________________________________

Reply via email to