title: Bash script in raspbian runs manually, won't run in cron
body: <p>Trying to turn a small TV into a photo frame so to speak, so I have a Raspberry Pi and I have a bash script at /home/pi/scripts/script.sh:</p>
  
  <pre><code>#!/bin/sh
  sudo /usr/bin/gpicview /home/pi/Downloads/test_5_25.png &gt;&gt; /home/pi/Downloads/test.log
  </code></pre>
  
  <p>My cron tab looks like this:
      <code># m h  dom mon dow   command
  * * * * * sh /home/pi/scripts/script.sh</code></p>
  
  <p>My syslog shows that its running:</p>
  
  <pre><code>May 27 04:32:01 raspberrypi /USR/SBIN/CRON[2999]: (pi) CMD (sh /home/pi/scripts/script.sh
  </code></pre>
  
  <p>But gpicview is not opening like when I run the script manually, and in my error log it shows...</p>
  
  <blockquote>
    <p>option parsing failed: Cannot open display: </p>
  </blockquote>
  
  <p>I thought maybe permissions or something, but I've double checked those to the best of my ability and cannot figure it out. Any clues would be greatly appreciated!!</p>