The following steps assume that a number of environment variables have been set, which are as follows:
- $PGDATA is the path to the PostgreSQL data directory, ending with /
- All required PostgreSQL connection parameters have been set
The steps are as follows:
- Create a new backup directory, if it is not already present, as follows:
cd $PGDATA mkdir ../standalone
- Set an archive_command. In postgresql.conf you will need to add the following lines and restart the server, or just confirm that they are present:
archive_mode = on archive_command = 'test ! -f ../standalone/archiving_active || cp -i %p ../standalone/archive/%f' ...