Post Backup Plugin
Post Backup plugin is called by mysql-zrm after completion of the backup run of a backup set. This plugin can be used to clean the MySQL server environment after the backup run.
Configuration
Post Backup plugin can be configured in the global mysql-zrm.conf or backup set specific mysql-zrm.conf configuration file. Additionally, from the command line, the post-backup-plugin-options parameter can be used to send a list of parameters to the pre-backup plugin.
The post-backup-plugin parameter should include the name and the full path to the plugin. The recommended location for plugins in /usr/share/mysql-zrm/plugins directory.
Plugin Interface
The first parameter is the name of post-backup-plugin-options specified in the mysql-zrm.conf configuration file.
The second parameter to the plugin is the databases/tables that were backed up in the backup run. The parameter can be one of the following:
- --all-databases - all databases in the MySQL server were backed up.
- --database <db1 db2 ...> - select list of databases that were backed up
- --database <db> and --tables <table1 table2 ...> - select list of tables in the database that were backed up.
The plugin should return 0 on success and and a non-zero value on failure. If the post-backup plugin fails, the backup status is set to "backup done with errors". But the Backup for the backup set is already complete and databases/tables can be recovered from the backup images.
Template
/usr/share/mysql-zrm/plugins/post-backup.pl is a template for a post backup plugin. Modify it to suit the environment.
Logs
Errors and Messages from the plugin are logged to mysql-zrm logs ( /var/log/mysql-zrm/mysql-zrm.log ).