Re: archive_command options?

Поиск
Список
Период
Сортировка
От Keith Fiske
Тема Re: archive_command options?
Дата
Msg-id CAODZiv6M6up6JemG7EMV0F8WfOMO4Op+SbADxdkfrYRJ8LX-Bw@mail.gmail.com
обсуждение исходный текст
Ответ на archive_command options?  (LEROY TENNISON <leroy_tennison@prodigy.net>)
Список pgsql-admin


On Wed, Apr 3, 2019 at 4:18 PM LEROY TENNISON <leroy_tennison@prodigy.net> wrote:
Postgresql documentation lists the following as an archive command for log shipping:

archive_command = 'test ! -f /mnt/server/archivedir/%f && cp %p /mnt/server/archivedir/%f'

The problem is that it is very fragile.  If anything breaks the copy (either system failing, network issues) then log shipping stops because the file exists in some intermediate state.  The result is that logs build up on the source system filling disk space.  I've had to deal with a few of these this week, in two cases the file system was 98% full.  Is there a reason rsync isn't used?  It has the ability to restart interrupted transfers.  I don't want to use it only to find out i got myself into another predicament.  Any other less-fragile options?  Thanks for the help.

It is definitely recommended to use something more reliable the cp command. The docs are just an example that your own command can be used for the archive_command.

I'd recommend one of the more well maintained backup tools out there such as pgbackrest. They have very robust archive & restore command options that are made to handle failure situations much more cleanly. They also provide good automated retention options.


--
Keith Fiske
Senior Database Engineer
Crunchy Data - http://crunchydata.com

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

Предыдущее
От: Prince Pathria
Дата:
Сообщение: Re: Configuration of django with master slave replication Postgres
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: archive_command options?