Cron script does not work despite running manually

I know there were a lot of questions about this, but I tried for a while without any luck. I have a simple python script script that creates a folder with a temporary name. It works fine when I run it manually, but nothing happens when I try to put it in crontab. Any idea where I am here? Here's the script: (located in / home / ec 2-user / cronscripts)

from subprocess import call
from time import time
import math

call(["mkdir","derp" +str(math.floor(time()))])

and crontab -l produces output

* * * * * python /home/ec2-user/cronscripts/testscript.py

I tried to add "root" to the command, but not the cube. I also tried to mess things up by explicitly setting the PATH variable in the script file.

From root@domU-12-31-38-00-AC-02.compute-1.internal  Wed Jun 15 19:57:01 2011
Return-Path: <root@domU-12-31-38-00-AC-02.compute-1.internal>
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 <root@domU-12-31-38-00-AC-02.compute-1.internal>; 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: <201106151957.p5FJv1Dc006093@domU-12-31-38-00-AC-02.compute-1.internal>
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 <root@domU-12-31-38-00-AC-02> usr/bin/python /home/ec2-user/cronscripts/testscript.py
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

/bin/sh: usr/bin/python: No such file or directory

, . , python, , . crontab -l, usr/bin/python . cron -?

+3
1

crontab.

0 */2 * * * /full/path/to/python /home/ec2-user/cronscripts/testscript.py

, : *? , ? .

+6

All Articles