A
A
Andrew2012-09-23 16:55:45
Django
Andrew, 2012-09-23 16:55:45

Logging the output of Django commands

Good afternoon!
Actually, the problem.
There is a cron that runs a bash script once a minute.
The bash script looks like
#!/bin/bash python /root/manage.py processmail >> /root/logs/mail/`date +%Y-%m-%d`.log

this. It logs everything perfectly until the script crashes with an error. That is, any exception is passed by and does not get into the log :(
Tell me a normal solution, please? I didn’t find others (

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
avalak, 2012-09-23
@avalak

&>> - append stdout and stderr to file

#!/usr/bin/env bash

python /root/manage.py processmail &>> /root/logs/mail/`date +%Y-%m-%d`.log

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question