title: Why doesn't my simple python script start tomcat work when launched as a cron job?
body: <p>I have a simple python script that starts tomcat, like so:</p>
  
  <pre><code>  print "Attempting to start tomcat ..."
    subprocess.call('sudo service '+instance+' start',shell=True)
  </code></pre>
  
  <p>Works fine when I run it myself at the command line.</p>
  
  <p>However, when I do a 'sudo crontab -e' and add it as a cron job like do ...</p>
  
  <pre><code>*/15 * * * * /home/myscript.py &gt; /home/myscript-output.txt
  </code></pre>
  
  <p>The script runs (because the output file gets created) but tomcat doesn't start.</p>
  
  <p>What am I doing wrong?</p>