Re: archive_commnad parameter question

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: archive_commnad parameter question
Дата
Msg-id 20210419211845.GA31797@hjp.at
обсуждение исходный текст
Ответ на archive_commnad parameter question  (Allie Crawford <CrawfordMA@ChurchofJesusChrist.org>)
Список pgsql-general
On 2021-04-19 21:09:13 +0000, Allie Crawford wrote:
> I am new in PostgreSQL and I am trying to understand what the “test” word is
> representing in the archive_command configuration that the PostgreSQL
> documentation is showing as the format on how to set up this parameter
>
> archive_command = 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/
> archivedir/%f'  # Unix
>
> Does anybody know what is “test” representing in this parameter configuration?

"test" is a unix command for testing stuff (as the name implies).
"test -f" in particular tests whether the argument exists and is a
regular file) and the "!" inverts the result.

So the whole line checks that the target *doesn't* already exist before
attempting to copy over it.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

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

Предыдущее
От: Gavan Schneider
Дата:
Сообщение: Re: archive_commnad parameter question
Следующее
От: Alan Hodgson
Дата:
Сообщение: Re: archive_commnad parameter question