Mysql-zrm-reporter: Difference between revisions
Line 17: | Line 17: | ||
==DESCRIPTION== | ==DESCRIPTION== | ||
''mysql-zrm-reporter'' utility provides pre-defined and user-defined reports about various MySQL database backup runs. The reports can be in text or HTML format. Backup report can be sent as a RSS feed. | |||
Backup reports can be configured using ''/etc/mysql-zrm/mysql-zrm-reporter.conf'' file parameters. For supported formats, see [[mysql-zrm-reporter.conf]](5). | |||
can be | |||
ZRM for MySQL configuration file, [[mysql-zrm.conf]](5) file contains HTML configuration and RSS feed configuration parameters for ''mysql-zrm-reporter'' utility. The list of ''mysql-zrm-reporter'' parameters are: | |||
; html-report-directory : Set the directory where text/HTML reports are written. This parameter is optional. Example: ''/var/www/html/mysql-zrm-reports/'' | |||
; html-report | ; html-reports : List of pre-defined report(s) to be generated after a backup run. Example: 'backup-status-info'' | ||
; webserver-url : RSS feed URL of a directory under document root of the web server. If this value is not specified in the configuration file, RSS feeds will not be generated. Example: <nowiki>''http://backupserver.company.com/reports/''</nowiki> | |||
; webserver-url : URL of a directory under document root of the web server | |||
; rss-header-location : The location of RSS feed properties file containing RSS feed channel and item properties. This parameter must be provided if ''webserver-url'' is specified. Example: ''/etc/mysql-zrm/RSS.header'' | ; rss-header-location : The location of RSS feed properties file containing RSS feed channel and item properties. This parameter must be provided if ''webserver-url'' is specified. Example: ''/etc/mysql-zrm/RSS.header'' | ||
Line 35: | Line 33: | ||
===BACKUP INFORMATION=== | ===BACKUP INFORMATION=== | ||
Each backup run generates the following information about the backup: | |||
; backup-date : Date and time stamp of backup run. | ; backup-date : Date and time stamp of backup run. | ||
Line 43: | Line 41: | ||
; backup-directory : The location of backup directory. | ; backup-directory : The location of backup directory. | ||
; backup-level : Lists the | ; backup-level : Lists the backup-level of this backup - 0 for a full and 1 for incremental backup. | ||
; raw-databases : List of databases backed up using mysqlhotcopy. If ''raw-tables'' parameter is present, this will have only one database listed. | ; raw-databases : List of databases backed up using ''mysqlhotcopy''. If ''raw-tables'' parameter is present, this will have only one database listed. | ||
; raw-tables : List of tables backed up using | ; raw-tables : List of tables backed up using ''mysqlhotcopy''. The name of the databases these tables belong to is specified as ''raw-databases''. | ||
; raw-databases-snapshot : List of databases backed up using lvm snapshots. | ; raw-databases-snapshot : List of databases backed up using lvm snapshots. When ''raw-tables'' parameter is specified, this will list only one database. | ||
; raw-tables-snapshot : List of tables backed up using mysqlhotcopy. | ; raw-tables-snapshot : List of tables backed up using mysqlhotcopy. The name of the database these tab | ||
les belong to is found under ''raw-databases''. | |||
; backup-time : Time taken for the complete backup run. Format is HH:MM:SS | ; backup-time : Time taken for the complete backup run. Format is HH:MM:SS | ||
; read-locks-time : Time | ; read-locks-time : Time read lock was held during the backup run. Format is HH:MM:SS | ||
; flush-logs-time : Time for flushing database pages to the disk. Format is HH:MM:SS | ; flush-logs-time : Time for flushing database pages to the disk. Format is HH:MM:SS | ||
; backup-size : The size of data | ; backup-size : The size, in megabytes, of data backed up. | ||
; backup-status : | ; backup-status : Status has three values. "Backup Failed" value means that there was a fatal err | ||
or. "Backup done with errors" means that though there was some error during back | |||
up but some of the databases and tables were probably backed up. "Backup succeed | |||
ed" means that the backup run was completed sucessfully. | |||
; logical-databases : List of databases backed up using mysqldump(1). | ; logical-databases : List of databases backed up using mysqldump(1). | ||
Line 67: | Line 69: | ||
; logical-tables : List of tables belonging to ''logical-databases'' backed up using mysqldump(1. | ; logical-tables : List of tables belonging to ''logical-databases'' backed up using mysqldump(1. | ||
; replication : List of | ; replication : List of replication files backed up namely master.info and relay-log.info | ||
; slave-load-files : Names of SQL_LOAD* files that were backed up. | ; slave-load-files : Names of SQL_LOAD* files that were backed up. | ||
Line 73: | Line 75: | ||
; incremental : Names of the binary log files backed up. | ; incremental : Names of the binary log files backed up. | ||
; backup-set : | ; backup-set : Name of the backup set this backup belongs to. | ||
; comment : Comment about the backup added by the administrator in the [[mysql-zrm.conf]](5) file. | ; comment : Comment about the backup added by the administrator in the [[mysql-zrm.conf]](5) file. | ||
; retention-policy : | ; retention-policy : Backup image will be retained for the time specified as parameter in Days/Weeks | ||
/Months/Years. For example: if the value is "10D" means the backup image will be retained 10 days from the ''backup-date''. This policy assumes 365 days in a year and 30 days in a month. | |||
; compress : Specifies that the backup | ; compress : Specifies that the backup was compressed. Default compression method is ''gzip'' program. The program used for compression is value for this parameter. | ||
; encrypt : Program used for encryption if the backups are encrypted. | ; encrypt : Program used for encryption if the backups are encrypted. |
Revision as of 01:59, 23 November 2006
NAME
mysql-zrm-reporter - MySQL backup reporting tool.
SYNOPSIS
mysql-zrm-reporter [--fields <name1,name2,"name3, name4, name5" ....>] [--destination <dir> ] [--where <fieldname=value>] [--type html] [--output <filename>] [--latest ] [--show <backup-method-info | backup-status-info | backup-retention-info | backup-performance-info | restore-info | selective-restore-info | replication-info | backup-app-performance-info > ] [--help]
DESCRIPTION
mysql-zrm-reporter utility provides pre-defined and user-defined reports about various MySQL database backup runs. The reports can be in text or HTML format. Backup report can be sent as a RSS feed.
Backup reports can be configured using /etc/mysql-zrm/mysql-zrm-reporter.conf file parameters. For supported formats, see mysql-zrm-reporter.conf(5).
ZRM for MySQL configuration file, mysql-zrm.conf(5) file contains HTML configuration and RSS feed configuration parameters for mysql-zrm-reporter utility. The list of mysql-zrm-reporter parameters are:
- html-report-directory
- Set the directory where text/HTML reports are written. This parameter is optional. Example: /var/www/html/mysql-zrm-reports/
- html-reports
- List of pre-defined report(s) to be generated after a backup run. Example: 'backup-status-info
- webserver-url
- RSS feed URL of a directory under document root of the web server. If this value is not specified in the configuration file, RSS feeds will not be generated. Example: ''http://backupserver.company.com/reports/''
- rss-header-location
- The location of RSS feed properties file containing RSS feed channel and item properties. This parameter must be provided if webserver-url is specified. Example: /etc/mysql-zrm/RSS.header
BACKUP INFORMATION
Each backup run generates the following information about the backup:
- backup-date
- Date and time stamp of backup run.
- mysql-version
- MySQL server version.
- backup-directory
- The location of backup directory.
- backup-level
- Lists the backup-level of this backup - 0 for a full and 1 for incremental backup.
- raw-databases
- List of databases backed up using mysqlhotcopy. If raw-tables parameter is present, this will have only one database listed.
- raw-tables
- List of tables backed up using mysqlhotcopy. The name of the databases these tables belong to is specified as raw-databases.
- raw-databases-snapshot
- List of databases backed up using lvm snapshots. When raw-tables parameter is specified, this will list only one database.
- raw-tables-snapshot
- List of tables backed up using mysqlhotcopy. The name of the database these tab
les belong to is found under raw-databases.
- backup-time
- Time taken for the complete backup run. Format is HH:MM:SS
- read-locks-time
- Time read lock was held during the backup run. Format is HH:MM:SS
- flush-logs-time
- Time for flushing database pages to the disk. Format is HH:MM:SS
- backup-size
- The size, in megabytes, of data backed up.
- backup-status
- Status has three values. "Backup Failed" value means that there was a fatal err
or. "Backup done with errors" means that though there was some error during back up but some of the databases and tables were probably backed up. "Backup succeed ed" means that the backup run was completed sucessfully.
- logical-databases
- List of databases backed up using mysqldump(1).
- logical-tables
- List of tables belonging to logical-databases backed up using mysqldump(1.
- replication
- List of replication files backed up namely master.info and relay-log.info
- slave-load-files
- Names of SQL_LOAD* files that were backed up.
- incremental
- Names of the binary log files backed up.
- backup-set
- Name of the backup set this backup belongs to.
- comment
- Comment about the backup added by the administrator in the mysql-zrm.conf(5) file.
- retention-policy
- Backup image will be retained for the time specified as parameter in Days/Weeks
/Months/Years. For example: if the value is "10D" means the backup image will be retained 10 days from the backup-date. This policy assumes 365 days in a year and 30 days in a month.
- compress
- Specifies that the backup was compressed. Default compression method is gzip program. The program used for compression is value for this parameter.
- encrypt
- Program used for encryption if the backups are encrypted.
- host
- Specifies the name of the host that was backed up.
- compress-encrypt-time
- This will provide time for both compression and encryption. If only compression is requested, this will show the time taken for compression, if only encryption is requested, this will show time for encryption only.
- innodb-data
- List of InnoDB shared data files backed up
- innodb-logs
- List of InnoDB logs backed up
OPTIONS
- --destination <dir>
- Specify the backup root directory. This parameter is optional and default value is /var/lib/mysql-zrm
- --fields <name1,name2,name3...>
- Specify list of backup parameters to display. List of valid field names are described in BACKUP INFORMATION section. This field is optional. If specific fields are not specified in the command line, backup-set, backup-date, backup-directory, backup-level, backup-status, comment are displayed by default. Spaces are not allowed in the list of names. If spaces (as in EXAMPLE 3), they should be in quotes.
- --where <fieldname=value>
- The tool will display the MySQL backup parameters where the field name matches value. This field is optional.
- --type html
- Output format of the report will be HTML.
- --output <filename>
- User should provide output file name to --output option, Tool creates HTML report(s) with name <filename> under "html" directory and text reports under "text" subdirectory. By default, these directories are created under the current working directory. The tool allows users to specify explicit directory location for reports in mysql-zrm.conf(5) using "html-report-directory" parameter. If this parameter is set, then the tool will create "html-report-directoy" directory (if it does not exist) and output report with name file name will be written to "html" and/or "text" subdirectory under "html-report-directory" path.
- --latest
- Report about the most recent backup run.
- --show <backup-method-info | backup-status-info | backup-retention-info | backup-performance-info | restore-info | selective-restore-info | replication-info | backup-app-performance-info>
- This option displays predefined reports based on the option. The list of reports that are available are:
- backup-status-info : backup-set,backup-date,backup-level,backup-status, backup comment
- backup-method-info : backup-set,raw-databases,raw-databases,logical-databases
- backup-retention-info : backup-set, backup-date, backup-level,backup-size,retention-policy
- backup-performance-info : backup-set, backup-date, backup-level, backup-size, backup-size-compressed, backup-time, compress-encrypt-time
- backup-app-performance-info : backup-set, backup-date, backup-level, backup-size, backup-time, read-locks-time, flush-logs-time
- restore-info : backup-set, backup-date, backup-level,backup-directory
- selective-restore-info : backup-set, backup-date, incremental
- replication-info : backup-set, backup-date, replication,slave-load-files
- --help
- Display help message and exit.
EXAMPLES
Following command displays backup date, location of backups, backup set name:
mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \ --fields backup-date,backup-directory,backup-set
Following command displays size of backup, backup set name, and date of backup:
mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \ --fields backup-date,backup-set,backup-size
Following command displays size of backup, backup set name, and date of backup for "config1" backup set:
mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \ --fields "backup-date, backup-set, backup-size" \ --where backup-set=config1
Following command displays backup status report for "config1" backup set:
mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \ --show backup-status-info \ --where backup-set=config1
Following command displays backup status report for "config1" backup set in HTML format and write the output to a file:
mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup \ --show backup-status-info --where backup-set=config1 \ --type html --output myreport.html
FILES
- /var/lib/mysql-zrm
- Directory under which all backup data is stored.
- /etc/mysql-zrm/mysql-zrm-reporter.conf
- Configuration file read by mysql-zrm-reporter tool.
RETURN VALUES
On success, zero is returned. On error,non-zero value is returned. Output messages are written to stdout and error messages to stderr.
SEE ALSO
mysql-zrm(1), mysql-zrm-scheduler(1), mysql-zrm-reporter.conf(5), mysql(1), Zmanda Recovery Manager for MySQL
AUTHOR
Zmanda Inc. (http://www.zmanda.com)