Configs2026年5月30日·1 分钟阅读

pgBackRest — Reliable PostgreSQL Backup and Restore

A robust open-source backup and restore solution for PostgreSQL with parallel compression, encryption, full/incremental/differential backups, and cloud storage support.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
pgBackRest
直接安装命令
npx -y tokrepo@latest install f712e179-5bdf-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

pgBackRest is a backup and restore tool designed specifically for PostgreSQL. It handles the complexity of WAL archiving, parallel backup compression, and multi-repository storage so database administrators can implement reliable disaster recovery without writing custom scripts.

What pgBackRest Does

  • Creates full, incremental, and differential backups of PostgreSQL clusters
  • Archives WAL segments for point-in-time recovery (PITR)
  • Compresses backups in parallel using multiple CPU cores
  • Encrypts backups at rest with AES-256-CBC
  • Stores backups on local disk, S3, Azure Blob, or Google Cloud Storage

Architecture Overview

pgBackRest runs as a standalone process alongside PostgreSQL. It communicates with the database via the PostgreSQL protocol for backup coordination and uses file-level copy for data transfer. WAL archiving integrates through the archive_command configuration. The tool maintains a manifest of all backed-up files to enable efficient incremental backups that only transfer changed pages.

Self-Hosting & Configuration

  • Install via package manager (apt, yum) or compile from source
  • Create a stanza configuration in /etc/pgbackrest/pgbackrest.conf
  • Set archive_command in postgresql.conf to route WAL to pgBackRest
  • Configure retention policies for full and differential backup counts
  • Add S3 or GCS credentials for off-site backup storage

Key Features

  • Delta restore that only replaces files that differ from the backup
  • Backup verification with checksum validation against the PostgreSQL catalog
  • Asynchronous WAL push and pull for high-throughput archiving
  • Multiple backup repositories for redundancy across storage providers
  • Standby server backup support to offload backup I/O from the primary

Comparison with Similar Tools

  • pg_dump — logical backup only, no incremental or PITR support
  • Barman — similar feature set but Python-based with different architecture
  • WAL-G — Go-based tool focused on cloud storage, less mature retention management
  • pg_basebackup — built-in but lacks compression, encryption, and incremental support
  • Borg + pg_dump — generic backup with PostgreSQL wrapper, not database-aware

FAQ

Q: Does pgBackRest support PostgreSQL streaming replication? A: Yes. It can back up from a standby replica to avoid impacting primary performance.

Q: How fast is incremental backup? A: Incremental backups only transfer changed blocks, making them significantly faster than full backups for large databases.

Q: Can I restore to a specific point in time? A: Yes. Specify a target timestamp, transaction ID, or LSN for point-in-time recovery using archived WAL segments.

Q: What PostgreSQL versions are supported? A: pgBackRest supports PostgreSQL 9.0 through the latest release, with full feature support from version 9.4 onward.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产