Here is simple backup script for Zabbix 2 configuration data (hosts, items, templates etc). It will not backup history/event/trend data, so backup file is relatively small.
Just replace ZBX_DB and ZBX_USER with Zabbix database name and username.
[code]
mysqldump -u ZBX_USER -p ZBX_DB \
–ignore-table=ZBX_DB.acknowledges \
–ignore-table=ZBX_DB.alerts \
–ignore-table=ZBX_DB.auditlog \
–ignore-table=ZBX_DB.auditlog_details \
–ignore-table=ZBX_DB.escalations \
–ignore-table=ZBX_DB.events \
–ignore-table=ZBX_DB.history \
–ignore-table=ZBX_DB.history_log \
–ignore-table=ZBX_DB.history_str \
–ignore-table=ZBX_DB.history_str_sync \
–ignore-table=ZBX_DB.history_sync \
–ignore-table=ZBX_DB.history_text \
–ignore-table=ZBX_DB.history_uint \
–ignore-table=ZBX_DB.history_uint_sync \
–ignore-table=ZBX_DB.trends \
–ignore-table=ZBX_DB.trends_uint \
| gzip > zbx_db.sql.gz
[/code]
Hi there, please note that there is a GitHub project (currently overhauled by myself) that does the same task with some additional checks: https://github.com/maxhq/zabbix-backup
Regards, maxhq