Backing up the database

Several different databases could be used for the Zabbix backend. We won't spend much time on database-specific information, besides a brief look at a simple possible way to create backups with the most widely used backend—MySQL—or one of its forks. A very simple way to back up a database with MySQL, compressing it on the way, would be this:

$ mysqldump zabbix --add-drop-table --add-locks --extended-insert --single-transaction --quick -u zabbix -p | bzip2 > zabbix_database_backup.db.bz2 

Here, we're allowing the backup to drop existing tables in the target database and telling it to lock each table when restoring, which is supposed to offer better restore performance. The parameters in the preceding code are explained as follows:

Now, you can let your usual backup software grab this created file and store it on a disk array, tape, or some other more exotic media.