Help - Search - Members - Calendar
Full Version: Running A Browser With Cron
Linuxhelp > Support > Technical Support
rupreckt1553
I'm trying to create a cronjob that will launch a browser, load a page, and then close it. I'm working with:

#!/bin/sh
/usr/X11R6/bin/mozilla http://www.somepage.com
exit

but cron complains

(mozilla-bin:2035): Gtk-WARNING **: cannot open display:

Any pointers?

Thanks!
Robert
Termina
What display is X running in?

Try:

/usr/X11R6/bin/mozilla --display=:7 http://www.somepage.com

If that doesn't work, try:

su -u yourusername /usr/X11R6/bin/mozilla --display=:7 http://www.somepage.com
DS2K3
If you dont need to be able to see the borwser, then you might be able to use lynx instead (since it doesnt need X to be installed/running)

D
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.