WebFaction
Community site: login faq

I am fairly new at this, have read many forum questions in various places, but none that got me the resolution to my question after trying the solutions presented. I know that my cron job cannot find the python commands it needs to execute but am not sure where to add what to my cron job or shell script. Paths are still confusing to me so help would be appreciated.

This is my crontab (running it every 2 minutes only for testing):
/2 * * * ~/webapps/django/myproject/cleanup.sh > ~/logs/user/cron.log 2>&1

This is my script called cleanup.sh:
cd /home/mysite/webapps/django/myproject
python2.6 manage.py cleanup

The script runs without problems when I run it from command line. When cron runs it I receive the error: /home/mysite/webapps/django/myproject/cleanup.sh: line 2: python2.6: command not found

asked 23 Jan '11, 14:10

Jørgen
113
accept rate: 0%

edited 23 Jan '11, 14:13


Try changing python2.6 manage.py cleanup to /usr/local/bin/python2.6 manage.py cleanup

permanent link

answered 23 Jan '11, 14:17

aaronh ♦♦
1.3k3
accept rate: 34%

That seems to have done the trick. Thanks a lot.

(23 Jan '11, 15:41) Jørgen
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×81

question asked: 23 Jan '11, 14:10

question was seen: 3,777 times

last updated: 23 Jan '11, 15:41

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM