Re: archive_command options?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Wed, Apr 3, 2019 at 4:18 PM LEROY TENNISON <leroy_tennison@xxxxxxxxxxx> 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.

https://pgbackrest.org/

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

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux