Note that there are some explanatory texts on larger screens.

plurals
  1. POCron script is not running, despite working when run manually
    text
    copied!<p>I know there have been plenty of questions about this, but I've been trying things for a while with no luck. I have a simple python testscript that creates a folder with a timestamped name. It works perfectly when I run it manually, but nothing happens when I try to put it into crontab. Any idea where I'm messing up here? Here's the script: (located in /home/ec2-user/cronscripts)</p> <pre><code>from subprocess import call from time import time import math call(["mkdir","derp" +str(math.floor(time()))]) </code></pre> <p>and crontab -l produces the output</p> <pre><code>* * * * * python /home/ec2-user/cronscripts/testscript.py </code></pre> <p>I've tried putting 'root' into the command as well, but no dice. I've also tried some to mess around with explicitly setting the PATH variable in the script file.</p> <pre><code>From root@domU-12-31-38-00-AC-02.compute-1.internal Wed Jun 15 19:57:01 2011 Return-Path: &lt;root@domU-12-31-38-00-AC-02.compute-1.internal&gt; Received: from domU-12-31-38-00-AC-02.compute-1.internal (localhost [127.0.0.1]) by domU-12-31-38-00-AC-02.compute-1.internal (8.14.4/8.14.4) with ESMTP id p5FJv1aS006094 for &lt;root@domU-12-31-38-00-AC-02.compute-1.internal&gt;; Wed, 15 Jun 2011 19:57:01 GMT Received: (from root@localhost) by domU-12-31-38-00-AC-02.compute-1.internal (8.14.4/8.14.4/Submit) id p5FJv1Dc006093; Wed, 15 Jun 2011 19:57:01 GMT Date: Wed, 15 Jun 2011 19:57:01 GMT Message-Id: &lt;201106151957.p5FJv1Dc006093@domU-12-31-38-00-AC-02.compute-1.internal&gt; From: root@domU-12-31-38-00-AC-02.compute-1.internal (Cron Daemon) To: root@domU-12-31-38-00-AC-02.compute-1.internal Subject: Cron &lt;root@domU-12-31-38-00-AC-02&gt; usr/bin/python /home/ec2-user/cronscripts/testscript.py Content-Type: text/plain; charset=UTF-8 Auto-Submitted: auto-generated X-Cron-Env: &lt;SHELL=/bin/sh&gt; X-Cron-Env: &lt;HOME=/root&gt; X-Cron-Env: &lt;PATH=/usr/bin:/bin&gt; X-Cron-Env: &lt;LOGNAME=root&gt; X-Cron-Env: &lt;USER=root&gt; /bin/sh: usr/bin/python: No such file or directory </code></pre> <p>This was the last entry I found in the root mail. It seems to not be able to find python, even though it's exactly where that say it is. And when I print crontab -l, usr/bin/python does have a leading slash. Do I need to change a cron path somewhere?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload