The steps are as follows:
- Create a new backup directory as a sibling of $PGDATA, if it is not already present, as follows:
cd $PGDATAmkdir ../standalone
- Create the archive directory as follows:
mkdir ../standalone/archive
- 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 ...