Make your PostgreSQL base backup from a plain connection to the server (as superuser)
Python
Switch branches/tags
Nothing to show

README

We take a base backup from a live server using a libpq connection.

Usage: pg_basebackup.py [-v] [-f] [-j jobs] dest dsn

Options:
  -h, --help            show this help message and exit
  --version             show version and quit
  -x, --pg_xlog         backup the pg_xlog files
  -v, --verbose         be verbose and about processing progress
  -d, --debug           show debug information, including SQL queries
  -f, --force           remove destination directory if it exists
  -j JOBS, --jobs=JOBS  how many helper jobs to launch
  -D DELAY, --delay=DELAY
                        pg_xlog subprocess loop delay, see -x
  -S, --slave           auxilliary process
  --stdin               get list of files to backup from stdin

Example:
python pg_basebackup.py /path/to/slave/pgdata host=remote user=postgres


Please not that while the backup is ongoing, we continue backuping the WAL
files in a loop (see -D for the loop delay), so that we have all what we
need on the slave as soon as the command finishes.


It should be able to use pg_basebackup.py -x to copy the WAL files in an
infinite loop in order to prepare a warm standby over a libpq connection.