Back ups for postgres are done using base backups in combination with write ahead logs (WAL) files.
| Type | Frequency | Storage |
| base backup | weekly or monthly |
3 cycles on local storage indefinitely on AWS S3
|
| write ahead logs | every 16 megabytes |
3 cycles indefinitely on AWS S3 |
| file | setting | |
| /etc/postgresql/xx/main/postgresql.conf | archive_mode = on | |
|
archive_command = '/home/backup/scripts/wal_archive_command.sh %f %p >> \ /home/backup/logs/wal_archive.log 2>&1'
|
bash command to copy wal files | |
| wal_level = logical |
logical - ability to record row level operations highest setting
|
The backup routines are contained in a git project pg-backup. To implement: