Re: error messages not getting logged when running script from cron

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: error messages not getting logged when running script from cron
Дата
Msg-id CACjxUsNQ+OTKtZvj_EdxQUGbmdWQrBD_jhCOsP+hnsYRU31OSg@mail.gmail.com
обсуждение исходный текст
Ответ на error messages not getting logged when running script from cron  (anj patnaik <patna73@gmail.com>)
Список pgsql-general
On Fri, Nov 20, 2015 at 5:09 PM, anj patnaik <patna73@gmail.com> wrote:

> 0 20 * * * db_backup.sh 1> /dev/null 2>&1 | mail -s "backup cron" myemail@comp.com
>
> I am re-directing stderr to stdout and then sending that to email.

But you are redirecting stdout (and therefore also stderr) to
/dev/null -- therefore there is no body input to the mail command.

> I get an email nightly with that title, but no error messages.

In that case you will probably be fine if you remove "1> /dev/null"
from the command.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


В списке pgsql-general по дате отправления:

Предыдущее
От: anj patnaik
Дата:
Сообщение: error messages not getting logged when running script from cron
Следующее
От: Tom Lane
Дата:
Сообщение: Re: error messages not getting logged when running script from cron