| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера