DBAtlas · Database operations atlas

Create the pgBackRest stanza and verify archiving (stanza-create/check)

PostgreSQLBackup & PITR

Command

# Create the stanza in the repository (once):
sudo -u postgres pgbackrest --stanza=<stanza> --log-level-console=info stanza-create
# Verify configuration and archiving end to end (switches WAL and waits for the segment to reach the repo):
sudo -u postgres pgbackrest --stanza=<stanza> --log-level-console=info check

What it does

stanza-create creates the cluster's metadata (system identifier, version) in the repository; check tests the PostgreSQL connection, archive_command and WAL arrival in the repository with an actual WAL switch.

When to use it

At initial setup, after changing archive_command or the repository, and as a monitoring/cron health check.

Caution

Run the commands as postgres (or the repository owner); running them as root breaks file ownership. After a major version upgrade, stanza-upgrade is required, not stanza-create. If check fails, PITR may be impossible even if backups complete.

Open in DBAtlas →

Related