I am running Ubuntu 11.10 (Unity interface) and I have created a Bash script that uses "gnome-open" to open a series of web pages that I use every morning. When I manually execute the script in the terminal, the Bash script works fine. Here's a sample script (this is all the same, so I shortened it):
#!/bin/bash gnome-open 'https://docs.google.com'; gnome-open 'https://mail.google.com';
Since it seemed to work well, I added work to my crontab (mine, not root) to execute every weekday at a specific time.
Here's the crontab entry:
30 10 * * 1,2,3,4,5 ~/bin/webcheck.sh
The problem is that this error is returned for every gnome-open command in the Bash script:
GConf-WARNING **: client could not connect to the D-BUS daemon: Failed to start the dbus daemon without $ DISPLAY for X11 GConf-error: no D-BUS daemon Error: no display specified
I tried to figure it out. The first thing I tried was to restart the daemon using SIGHUP:
killall -s SIGHUP gconfd-2
This did not work, so I tried to start the dbus daemon using this code from the man page to start dbus:
## test for an existing bus daemon, just to be safe if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then ## if not found, launch a new one eval `dbus-launch --sh-syntax --exit-with-session` echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS" fi
But it did nothing.
I tried adding just "dbus-launch" at the top of my Bash script, and that didn't work either.
I also tried editing crontab to include the path to Bash, because I saw this sentence in a different thread, but that didn't work.
Any ideas on how I can run this and run it?