## Ubuntu 安装

### 依赖
```
sudo apt-get install postgresql-server-dev-all

sudo apt-get install libselinux1-dev libzstd-dev liblz4-dev libpam0g-dev libkrb5-dev libreadline-dev
sudo apt-get install clang-14

```

### 编译
```

git clone https://github.com/ossc-db/pg_rman.git
cd pg_rman

make

make install

```



## 初始化


```

/usr/lib/postgresql/15/bin/pg_rman init \
    -B /data/postgresql/backup \
    -D /var/lib/postgresql/15/main/ \
    -G /etc/postgresql/15/main/postgresql.conf \
    -A /data/postgresql/wal/ \
    -S /var/log/postgresql/
```


## 全量备份

```
PGPASSWORD=abc@123 /usr/lib/postgresql/15/bin/pg_rman backup -b f -B /data/postgresql/backup -D /var/lib/postgresql/15/main/ -G /etc/postgresql/15/main/postgresql.conf -A /data/postgresql/wal/ -S /var/log/postgresql/ -d coal_master -h localhost -p 5432 -U postgres

/usr/lib/postgresql/15/bin/pg_rman validate -B /data/postgresql/backup/
/usr/lib/postgresql/15/bin/pg_rman show -B /data/postgresql/backup/

```