WebFaction
Community site: login faq

Hi

I am currently using centos and have two installations of python - system installed python 2.4 and local installation python 2.6. I have some scripts that execute perfectly well when I run them manually by calling "python2.6 test.py" from terminal while when I try to schedule it from the crontab "/usr/local/bin/python2.6 test.py" gives no mail in pine. It does not execute at all.

My problem is that the local installation seems to have numPy in the site-packages whereas the Python folder in system directory does not. I really need to set this up and I am terribly new to all this. Please help!

Ayesha

asked 28 Jan '11, 11:04

SiriuslyAsh
1112
accept rate: 0%

Are you giving the full path to the test.py script? E.g.

/usr/local/bin/python2.6 /home/<me>/test.py
(28 Jan '11, 11:15) David L ♦♦

Yes I am. Still no luck. :(

The crontab line reads "* * /usr/local/bin/python2.6 /home/ayesha/test.py".

(28 Jan '11, 11:22) SiriuslyAsh

If that's your cron job, then that's the problem :)

You're missing a three time fields:

* * * * * /usr/local/bin/python2.6 /home/ayesha/test.py
(28 Jan '11, 11:28) David L ♦♦

OMG Im so silly. Yes my cron job exactly reads this :

/usr/local/bin/python2.6 /home/ayesha/test.py No Luck.

(10 Aug '11, 02:32) SiriuslyAsh

Okay, so here's how I got it going (quite a long time back, just didn't find time to update it here):

I made the scripts executable by all by doing : chmod 755 /home/ayesha/test.py

Then I included #!/usr/local/bin/python2.6 as the very first line in the code and everything fell in place.

Worked like a charm.

permanent link

answered 10 Aug '11, 02:31

SiriuslyAsh
1112
accept rate: 0%

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
×50
×15
×7

question asked: 28 Jan '11, 11:04

question was seen: 4,366 times

last updated: 10 Aug '11, 02:32

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