title: fswebcam cron: Device or resource busy
body: <p>I'm trying to get a picture from webcam on Raspberry Pi every minute. So I wrote a script:</p>
  
  <p><code>NOW=$(date +"%H-%M-%S")
  fswebcam -r 640x480 /home/pi/$NOW.jpg</code></p>
  
  <p>When I run it form command line like <code>/home/pi/webcam_script</code>, it works just fine. Then I add a task to cron using <code>crontab -e</code>:</p>
  
  <pre><code>0-59 * * * * /home/pi/webcam_script &gt;&gt; cronlog 2&gt;&amp;1
  </code></pre>
  
  <p>As a result, no pictures are captured. In <code>cronlog</code> file I see the following error message:</p>
  
  <pre><code>Error selecting input 0
  VIDIOC_S_INPUT: Device or resource busy
  </code></pre>
  
  <p>So, what is wrong and how can I automatically get pictures from a webcam</p>