Обсуждение: Capturing output of vacuumdb and pg_dump

Поиск
Список
Период
Сортировка

Capturing output of vacuumdb and pg_dump

От
"Matt Mello"
Дата:
Hello, all.

I am a linux shell [bash/sh] newbie.  I want to capture the output of the
vacuumdb and pg_dump commands to a log file.  I want all of the lines that
are normally displayed on the screen to be *appended* to a single log file
that I can inspect offline at my convenience.  I have discovered that
">>logfile" won't get all of the data.  Can someone point me to an example
of how to do that?

Thanks!

--
Matt Mello


Re: Capturing output of vacuumdb and pg_dump

От
Tom Lane
Дата:
"Matt Mello" <alien@spaceship.com> writes:
> I am a linux shell [bash/sh] newbie.  I want to capture the output of the
> vacuumdb and pg_dump commands to a log file.  I want all of the lines that
> are normally displayed on the screen to be *appended* to a single log file
> that I can inspect offline at my convenience.  I have discovered that
> ">>logfile" won't get all of the data.  Can someone point me to an example
> of how to do that?

You're missing stderr.  On sh/bash type shells you want

    foo >>logfile 2>&1

There is some other locution on csh and its descendants, but I forget
what.

            regards, tom lane