'How to take periodic pg_basebackup without losing any WAL files. How to pause wal archive
Environment: PostgreSQL 13.x Docker container.
I took a pg_basebackup and have configured PostgreSQL 13.x with wal_archive=on. And it is working as expected.
I see that it is recommended to take pg_basebackup periodically. How can I rotate the base_backups weekly or daily?
Example: If new pg_basebackup is running every Saturday night, Should we consider stopping/pausing wal_archiving for that duration?
#Locations:
pg_basebackup : /db-backup/basebackup
archive_command: /db-backup/wal_files
So want to move archive db-backup every Saturday.
mv /db-backup /db-backup-old
While performing these Should I pause the wal_archiving process? As per docs
we can stop/pause it by setting 24.3.1. Setting up WAL archiving
archive_command = ''
Is this the right approach? If so, should we reload the configuration OR any way we can update this configuration on-the-fly? Note: using Postgres-docker container.
What I am trying to achieve is:
If some data is getting written on DB during DB backup rotation, either it should be in new basebackup OR new wal-files directory.
Please correct me if these confusions are irrelevant.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
