Postgres Archivelog: differenze tra le versioni
Jump to navigation
Jump to search
Nessun oggetto della modifica |
|||
Riga 17: | Riga 17: | ||
#!/bin/bash |
|||
DEST=/backup/postgres/ |
|||
ARCH=/data/pg_archive/ |
|||
DD=$( date +%Y%m%d%H%M ) |
|||
## backup fisico del database |
|||
pg_basebackup -D ${DEST}/fisico_${DD} -Ft -z -P |
|||
pg_archivecleanup ${ARCH} $( ls -1t ${ARCH} | head -1 ) |
|||
[[Categoria:Database]] |
[[Categoria:Database]] |
Versione attuale delle 19:10, 22 mar 2022
https://www.postgresql.org/docs/14/continuous-archiving.html
-- alter system set wal_level=replica; alter system set archive_mode=on; alter system set wal_compression=on; alter system set archive_command = 'test ! -f /data/pg_archive/%f && cp %p /data/pg_archive/%f' ;
eseguire backup
https://www.postgresql.org/docs/current/app-pgbasebackup.html
pg_basebackup -D /backup/postgres/fisico -Ft -z -P
gestione archivelog
#!/bin/bash DEST=/backup/postgres/ ARCH=/data/pg_archive/ DD=$( date +%Y%m%d%H%M ) ## backup fisico del database pg_basebackup -D ${DEST}/fisico_${DD} -Ft -z -P pg_archivecleanup ${ARCH} $( ls -1t ${ARCH} | head -1 )