WebFaction
Community site: login faq

in the crontab i add: 10,20,30,40,50,59 * * 10 * /home/username/bin/sendmail.py >> ~/logs/user/cron.log 2>&1

in my python scripts is:

#!/usr/bin/env python2.7

but it can't work.

hope you can help me, 3Q!

asked 17 Oct '12, 04:00

bojanliu
111
accept rate: 0%

Hi, do you have any errors logged at ~/logs/user/cron.log ? Please post them here.

(17 Oct '12, 04:14) todork

the errors is: /usr/bin/env: python2.7^M: No such file or directory /usr/bin/env: python2.7^M: No such file or directory

(17 Oct '12, 04:26) bojanliu

Hi,

It seems that you've edited the sendmail.py script with some Windows-style editor such as Notepad that adds extra carriage returns at the end of each line. You should use a more advanced editor such as Ultraedit instead, that can save files in UNIX format. To fix this file, you can run "dos2unix ~/bin/sendmail.py" in SSH.

permanent link

answered 17 Oct '12, 04:44

todork
1.2k5
accept rate: 34%

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:

×337
×81
×50

question asked: 17 Oct '12, 04:00

question was seen: 3,589 times

last updated: 17 Oct '12, 04:44

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