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

Поиск
Список
Период
Сортировка
Искать
От
Melvin Davidson
Тема
Re: error messages not getting logged when running script from cron
Дата
Msg-id
CANu8Fiz4sKrT2OuCK3KFapPzD2xtxpC8M0EuFFtguUwf4Uddhw@mail.gmail.com
Ответ на
Список
Дерево обсуждения
error messages not getting logged when running script from cron anj patnaik <patna73@gmail.com>
Re: error messages not getting logged when running script from cron Tom Lane <tgl@sss.pgh.pa.us>
Re: error messages not getting logged when running script from cron John R Pierce <pierce@hogranch.com>
Re: error messages not getting logged when running script from cron Melvin Davidson <melvin6925@gmail.com>
Re: error messages not getting logged when running script from cron anj patnaik <patna73@gmail.com>
Re: error messages not getting logged when running script from cron Adrian Klaver <adrian.klaver@aklaver.com>
Re: error messages not getting logged when running script from cron Kevin Grittner <kgrittn@gmail.com>
You could also try tweaking the following attached backup script.
Caution, I wrote this quickly from a skeleton script and has not been tested.

On Mon, Nov 23, 2015 at 3:21 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
anj patnaik <patna73@gmail.com> writes:
> My cron tab entry:

> 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.

Uh, read it again: you're redirecting stdout to /dev/null and then
redirecting stderr to go where stdout goes.  So all output is
going to the bit bucket, not the pipe.

                        regards, tom lane


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you
wish to share my fantasy is entirely up to you.
В списке pgsql-general по дате отправления
От: Tom Lane
Дата:
От: John R Pierce
Дата:
FAQ