title: Can Cron Jobs Use Gnome-Open?
body: <p>I am running Ubuntu 11.10 (Unity interface) and I created a Bash script that uses 'gnome-open' to open a series of web pages I use every morning. When I manually execute the script in the Terminal, the bash script works just fine. Here's a sample of the script (it's all the same so I've shortened it):</p>
  
  <pre><code>#!/bin/bash
  
  gnome-open 'https://docs.google.com';
  gnome-open 'https://mail.google.com'; 
  </code></pre>
  
  <p>Since it seemed to be working well, I added a job to my crontab (mine, not root's) to execute every weekday at a specific time. </p>
  
  <p>Here's the crontab entry:</p>
  
  <pre><code>30 10 * * 1,2,3,4,5 ~/bin/webcheck.sh
  </code></pre>
  
  <p>The problem is this error gets returned for every single 'gnome-open' command in the bash script: </p>
  
  <blockquote>
    <p>GConf-WARNING **: Client failed to connect to the D-BUS daemon:
    Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
    GConf Error: No D-BUS daemon running
    Error: no display specified</p>
  </blockquote>
  
  <p>I did some searching to try and figure this out. The first thing I tried was relaunching the daemon using SIGHUP:</p>
  
  <pre><code>killall -s SIGHUP gconfd-2
  </code></pre>
  
  <p>That didn't work so I tried launching the dbus-daemon using this code from the manpage for dbus-launch:</p>
  
  <pre><code>## 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
  </code></pre>
  
  <p>But that didn't do anything.</p>
  
  <p>I tried adding simply 'dbus-launch' at the top of my bash script and that didn't work either. </p>
  
  <p>I also tried editing the crontab to include the path to Bash, because I saw that suggestion on another thread but that didn't work.</p>
  
  <p>Any ideas on how I can get this up and running?</p>