getting pg_basebackup to use remote destination - Mailing list pgsql-general

From Chuck Martin
Subject getting pg_basebackup to use remote destination
Date
Msg-id CAFw6=U3TkX=qGEshwUS4iipx3E2SUcP5=G7L6v2AgBGywiOHnA@mail.gmail.com
Whole thread Raw
Responses Re: getting pg_basebackup to use remote destination
Re: getting pg_basebackup to use remote destination
Re: getting pg_basebackup to use remote destination
List pgsql-general
I thought I knew how to do this, but I apparently don't. I have to set up a new server as a standby for a PG 11.1 server. The main server has a lot more resources than the standby. What I want to do is run pg_basebackup on the main server with the output going to the data directory on the new server. But when I give this command:

pg_basebackup -D "ssh root@10.0.1.16:/mnt/dbraid/data" -P -v -X s


it instead writes to my root drive which doesn't have the space, so it fails and deletes the partial backup. 


While I think I could figure out how to backup to a local directory then rsync it to the new server, I'd like to avoid that due to the 750GB size. 


Is there a way to tell pg_basebackup to use a remote destination for output? Or do I have to run pg_basebackup on the standby server?


And while I'm asking, has anyone yet written a guide/tutorial for PG 11 replication? Everything I find online is very old.


Chuck Martin
Avondale Software

pgsql-general by date:

Previous
From: Glenn Schultz
Date:
Subject: Recursive CTE
Next
From: Adrian Klaver
Date:
Subject: Re: getting pg_basebackup to use remote destination