Synology Docker Zabbix Backup and Restore

Backup the Database:
The most important settings are all stored in the Database. The easiest and most secure way to save them is to export all the Data at a specific time and store them on the Synology Raid. So this is my solution:

  1. Go to „Control Panel“ -> „Task Schedueler“ and create a „User-defined script“
  1. Choose the name you want to have and set the User to „root“
  1. Choose the time you want to have the script running
  1. Change the code to your settings.
docker exec Zabbix-Server /usr/bin/mysqldump -u root --password=zabbix zabbix > /volume1/docker/Zabbix/backup.sql

tar -zcvf /volume1/docker/Zabbix/$(date +%Y%m%d).tar.gz /volume1/docker/Zabbix/backup.sql
rm /volume1/docker/Zabbix/backup.sql

Restore Database
If you want to restore your Database you have to enable SSH and connect with your Terminal. Then you can paste following command: (Attention you have to unpack the tar file if you use my Backup scirpt

cat /volume1/docker/Zabbix/backup.sql | docker exec -i Zabbix-Server /usr/bin/mysql -u zabbix --password=zabbix zabbix

Links:
https://gist.github.com/spalladino/6d981f7b33f6e0afe6bb

  2 comments for “Synology Docker Zabbix Backup and Restore

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

Time limit is exhausted. Please reload the CAPTCHA.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.