How to do it…

The steps are as follows:

  1. Create a new backup directory as a sibling of $PGDATA, if it is not already present, as follows:
cd $PGDATAmkdir ../standalone

 

  1. Create the archive directory as follows:
mkdir ../standalone/archive
  1.  Start archiving with the following command:
pg_receivewal -D ../standalone/archive/

This command will not return, because pg_receivewal will run until interrupted. So you must open a new terminal session to perform the next steps, starting with step 4.

We describe first how to configure streaming archiving (steps 2 and 3); for file-based archiving follow the alternate steps 2a and 3a instead.

    • 2a: Set an archive_command. In postgresql.conf you will need to add the following lines and restart the ...

Get PostgreSQL 10 Administration Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.