Difference between revisions of "Zabbix backup"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "https://catonrug.blogspot.com/2020/05/postgresql-zabbix-database-backup.html ``` Backup: pg_dump \ --dbname=DATABASE \ --host=HOST \ --username=USER \ --file=zabbix44.dump \...")
(No difference)

Revision as of 15:58, 29 May 2022

https://catonrug.blogspot.com/2020/05/postgresql-zabbix-database-backup.html

Backup:
pg_dump \
--dbname=DATABASE \
--host=HOST \
--username=USER \
--file=zabbix44.dump \
--format=custom \
--blobs \
--verbose \
--exclude-table-data '*.history*' \
--exclude-table-data '*.trends*'
To ignore hypertables:
pg_dump \
--dbname=DATABASE \
--host=HOST \
--username=USER \
--file=zabbix44.dump \
--format=custom \
--blobs \
--verbose \
--exclude-schema=_timescaledb_internal \
--exclude-schema=_timescaledb_cache \
--exclude-schema=_timescaledb_catalog \
--exclude-schema=_timescaledb_config \
--exclude-table-data '*.history*' \
--exclude-table-data '*.trends*'
With maximum compression:
pg_dump \
--dbname=DATABASE \
--host=HOST \
--username=USER \
--file=zabbix40.pg10.dump \
--format=custom \
--compress=9 \
--blobs \
--verbose \
--exclude-table-data '*.history*' \
--exclude-table-data '*.trends*'
Restore:
pg_restore \
--dbname=<database> \
--host=<host> \
zabbix44.dump