title: How to set a cron job to open a web page in the browser using crontab?
body: <p>I use a website to order food, and I would like this website to be automatically opened in the browser at 11 am day.</p>
  
  <p>I opened crontab using "crontab -e" and tried this:</p>
  
  <pre><code>59 10 1-31 1-12 SUN,MON,TUE,THU google-chrome --new-window http://food.com
  </code></pre>
  
  <p>and also tried this:</p>
  
  <pre><code>59 10 1-31 1-12 SUN,MON,TUE,THU x-www-browser http://food.com
  </code></pre>
  
  <p>But they sent me an email instead of opening the website:</p>
  
  <pre><code>(x-www-browser:16597): Gtk-WARNING **: cannot open display:
  (google-chrome:16883): Gtk-WARNING **: cannot open display:
  </code></pre>
  
  <p>Thanks!</p>
  
  <hr>
  
  <p><strong>Update</strong>: The solution was adding "export DISPLAY=:0 &amp;&amp;" to crontab. i.e.:</p>
  
  <pre><code>53 10 * 1-12 SUN,MON,TUE,THU export DISPLAY=:0 &amp;&amp; google-chrome --new-window http://www.foodsite.com
  </code></pre>