WebFaction
Community site: login faq

I have an application that I built within Django and I use manage.py to call it.

My logging is setup to print to console and to a log file. This works perfectly if I run it from the command line:

python2.7 manage.py approve_payment

The output is printed both to console and log file as expected. Great. However, I try and set this up using cron:

* * * * * python2.7 /home/kenyum/webapps/yum/yum/manage.py approve_payment >> ~/test.txt

And I don't get any output in either that text file, nor in the log file. Thus, I have no idea if the job is running. How do I get the output into the console or log?

asked 15 Jun '12, 15:34

JamesD
111
accept rate: 0%


Sigh, sorry, but I figured it out. I saw in another post that you have to have "2>&1" at the end of the file name. I added that and it worked. I had set up the MAILTO at the top of the cron as well, but that didn't seem to ever send me an email.

Turns out just using python2.7 doesn't work

permanent link

answered 15 Jun '12, 15:39

JamesD
111
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:

×910
×50
×9

question asked: 15 Jun '12, 15:34

question was seen: 5,225 times

last updated: 15 Jun '12, 15:39

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2021 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