The rest of this recipe assumes the following answers to the key questions:
- The archive is a directory, such as /backups/archive, on a remote server for disaster recovery named $DRNODE
- We send WAL files to the archive using rsync; however, WAL streaming can also be used, by changing the recipe in a way similar to the previous one
- Base backups are also stored on $DRNODE, in the /backups/base directory
- Base backups are made using rsync
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 /
- $DRNODE is the name of the remote server
- $BACKUP_NAME is an identifier for the backup
- All the required PostgreSQL connection ...