Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iFXzp-0006L4-8n for pgsql-general@arkaria.postgresql.org; Wed, 02 Oct 2019 06:20:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iFXzo-0004rI-62 for pgsql-general@arkaria.postgresql.org; Wed, 02 Oct 2019 06:20:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iFXxV-0000Wz-RZ for pgsql-general@lists.postgresql.org; Wed, 02 Oct 2019 06:17:57 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iFXxT-00086X-N6 for pgsql-general@lists.postgresql.org; Wed, 02 Oct 2019 06:17:57 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 0A4F75F79F; Wed, 2 Oct 2019 02:17:54 -0400 (EDT) Date: Wed, 2 Oct 2019 02:17:54 -0400 From: Stephen Frost To: Peter Eisentraut Cc: Vikas Sharma , pgsql-general@lists.postgresql.org Subject: Re: pg_receivexlog or archive_command Message-ID: <20191002061754.GE6962@tamriel.snowman.net> References: <500e2a7e-8c40-32bb-432b-8f728daf4e5a@2ndquadrant.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="i4FDYeXdkIkVObV/" Content-Disposition: inline In-Reply-To: <500e2a7e-8c40-32bb-432b-8f728daf4e5a@2ndquadrant.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --i4FDYeXdkIkVObV/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Peter Eisentraut (peter.eisentraut@2ndquadrant.com) wrote: > On 2019-09-23 10:25, Vikas Sharma wrote: > > I am wondering which one is the best way to archive the xlogs for Backup > > and Recovery - pg_receivexlog or archive_command. >=20 > I recommend using pg_receivexlog. It has two important advantages over > archive_command: 1) You can have multiple instances of pg_receivexlog > running and copying things to different places. This is complicated to > do correctly with archive_command. 2) pg_receivexlog will fsync the > files it writes. This is also complicated to do correctly with > archive_command. Yes, it definitely is difficult to write your own archive_command, in general, so, please, just don't. Use one of the existing tools that have been well tested and written specifically to work with PG and to provide the guarantees that an archive command should. Thanks, Stephen --i4FDYeXdkIkVObV/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJdlEESAAoJEO1sijiDR2RVYDIP/jC7fqyQ0rFC8aW43V9eJXn6 9qjfKDFpg5bT3889w1fjEOtuvCIPOid7Sl7wLYKmHjSCIBioYtPraDTdXc1KDTSB r9y43f1dZ4ArxY6K1zTH4qgJBhDNChHsw2UPXMDB5fBAdCWa44fHOMiYL1Oc5S2V vsz2BfxH8GBqqrSb6NbuFzkqz0SDjUleFt+JesV2oc27PkZzRZmSDnBK/qhNENFb N0FqmsgW7VHUtuX5/wUpBTIKHi9r867jBBq4MPGxI3oj0hf317FUBRKNaLLMxps5 ine38D4gIU3vmUWeo6LlJ09UxV6yKf4u3aFVXAc9ahGmM+rxUq0+d8WNyyrSQXVv hYs2GTMeFco8N4x3hckHH6l0A+MMCYCZxYrPlYkiofOk778SwhtKQVkQ+JL9ZeN1 NB20LbFIedESJRcu4AzEkZUOoAoxn6HQrt7vd5QT5eY08useUbATSH3um/sJT6v9 XhCe03ZHGcajXP8hHwHMIgJ8QlMpDuyEkaoZVzy2j7Nge/TzSE0Sr3M1QvjTCZFn VwzKl0KPnw/HxC+NPybmK8iNEM03NhOAUDQVK+oTsDSsVC2sVv3syzZF59GLyzOT cEEgu2K2X6Gs2DMB4KA2atIpV3deXWYuWEweRYwQ2eTohldEodrT+y1TCFuvEveF YFtp5UNXKr8tiFNgNsFI =Z5hR -----END PGP SIGNATURE----- --i4FDYeXdkIkVObV/--