Re: running a Python script with crontab

From: Michael Heiming (michael+USENET_at_www.heiming.de)
Date: 03/02/05


Date: Wed, 2 Mar 2005 08:09:16 +0100

In comp.unix.shell 18k11tm001@sneakemail.com:
> I have run many crontab jobs before, but they have always been BASH
> scripts. Now I am trying to run a Python script with crontab, but I am
> getting this error message:

> /usr/bin/env: No such file or directory

> It obviously refers to the first line of my script, which is

> #!/usr/bin/env python

IIRC that instructs the system to search in $PATH for 'python',
since $PATH is rather limited per default if starting from cron,
it can't be found. Try using the complete path to python:

 #!/usr/local/bin/python

Or where ever it is.

[..]

Good luck

-- 
Michael Heiming (X-PGP-Sig > GPG-Key ID: EDD27B94)
mail: echo zvpunry@urvzvat.qr | perl -pe 'y/a-z/n-za-m/'
#bofh excuse 261: The Usenet news is out of date


Relevant Pages

  • Re: bash vs. python scripts - which one is better?
    ... I'm about to learn bash or python scripting. ... If you plan to do much system administration, learning bash scripting is worthwhile. ... - You will often need to modify or maintain other people's bash scripts, since that's how most startup scripts and the like are written. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
    (Debian-User)
  • Re: Automating FTP file transfers
    ... >Thanks very much for the help guys I now know how to connect using python ... >Just wondering about the bigger picture with regards to sys admin scripts, ... >Just wondering if you think I should be trying to execute the in built OS ... than what bash, .bat, and so on offer. ...
    (comp.lang.python)
  • Re: Automating FTP file transfers
    ... >Thanks very much for the help guys I now know how to connect using python ... >Just wondering about the bigger picture with regards to sys admin scripts, ... >Just wondering if you think I should be trying to execute the in built OS ... than what bash, .bat, and so on offer. ...
    (comp.unix.admin)
  • Where to put scripts
    ... we are creating lot's of little scripts on our servers, some in bash, some in ... python and other languages may be picked as well. ... scripts all ...
    (Debian-User)
  • Re: Where to put scripts
    ... we are creating lot's of little scripts on our servers, some in bash, some in ... python and other languages may be picked as well. ... scripts all ...
    (Debian-User)