PostgreSQL备份恢复之pgbackRest备份

接着上一篇安装部署文档:https://blog.csdn.net/weixin_41561946/article/details/104183555

五、 pgbackRest备份

1. 执行全量备份

[cddb@cddb-node1 ~]$pgbackrest --stanza=demo --log-level-console=info backup
P00 WARN: no prior backup exists, incr backup has been changed to full
在这里插入图片描述
疑问:表空间所在目录怎么备份?

2. 执行差异备份

[cddb@cddb-node1 ~]$ pgbackrest --stanza=demo --log-level-console=info --type=diff backup
PostgreSQL备份恢复之pgbackRest备份_第1张图片

3. 执行增量备份

[cddb@cddb-node1 ~]$ pgbackrest --stanza=demo --log-level-console=info --type=incr backup
PostgreSQL备份恢复之pgbackRest备份_第2张图片

4. Fast Start 备份选项

start-fast=y
[cddb@cddb-node1 ~]$ vi /etc/pgbackrest/pgbackrest.conf
PostgreSQL备份恢复之pgbackRest备份_第3张图片
PostgreSQL备份恢复之pgbackRest备份_第4张图片

5. 并行备份

[demo]
pg1-path=/cddb5.0/data2/
pg1-port=7321
[global]
repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO
repo1-cipher-type=aes-256-cbc
repo1-path=/var/lib/pgbackrest
repo1-retention-full=2
start-fast=y
process-max = 3
[global:archive-push]
compress-level=3
PostgreSQL备份恢复之pgbackRest备份_第5张图片
说明: 开启三个并行,备份时间确实减少的5分钟

6. 查看备份信息

[cddb@cddb-node1 ~]$ pgbackrest info
PostgreSQL备份恢复之pgbackRest备份_第6张图片

7. 配置自动调度

#m h dom mon dow command
30 06 * * 0 pgbackrest --type=full --stanza=demo backup
30 06 * * 1-6 pgbackrest --type=diff --stanza=demo backup
接着下一篇pg恢复文档:
https://blog.csdn.net/weixin_41561946/article/details/104439619

你可能感兴趣的:(备份,postgresql)