OS: Ubuntu 16.04.4 LTS
database: postgresql-10.5

pg_rman 是一款优秀的postgresql 在线备份和恢复的工具.

下载: https://github.com/ossc-db/pg_rman
使用文档: http://ossc-db.github.io/pg_rman/index.html
参考: https://github.com/ossc-db/pg_rman/tree/master
各版本软件包: https://github.com/ossc-db/pg_rman/releases

因为数据库版本是:postgresql-10.5,需要下载相应的pg_rman REL_10_STABLE: branch for postgresql-10.5

# su - postgres
$ mkdir packages
$ cd packages/

$ git clone https://github.com/ossc-db/pg_rman.git
$ cd pg_rman/
$ git branch -a          查看所有版本的分支

PostgreSQL物理备份工具pg_rman(八)_第1张图片

$ git checkout REL_10_STABLE   指定postgresql版本对应的分支

PostgreSQL物理备份工具pg_rman(八)_第2张图片

$ git status          查看状态

PostgreSQL物理备份工具pg_rman(八)

$ make install         开始安装pg_rman
输出内容:

PostgreSQL物理备份工具pg_rman(八)_第3张图片

如果make install 出现报错:
PostgreSQL物理备份工具pg_rman(八)

解决办法:

$ vim Makefile
PG_CONFIG=/services/database/install/postgresql/bin/pg_config
说明: 指定你postgresql的可执行文件的路径。

再次执行:
$make  install       即可安装完成。

pg_rman备份工具已经安装完成。