MYSQL-ZRM-REPORTER(1)

πŸ“¦ version 3.0, in epel 9, fedora 43, fedora 44

πŸ’– mysql-zrm-reporter πŸ’–

okay bestie, this is the manual page for mysql-zrm-reporter from ZRM for MySQL. It's a big one, so buckle up β€” this is part 1, and there's more coming. 🫢


✨ NAME ✨

mysql-zrm-reporter β€” the ZRM for MySQL backup reporting utility. She reports. That's her whole job. πŸ‘‘


🌸 SYNOPSIS 🌸

mysql-zrm-reporter [--fields name1, name2, name3, name4, name5 ....]
                   [--destination dir]
                   [--where fieldname=value]
                   [--type html]
                   [--output filename]
                   [--latest]
                   [--noheader]
                   [--show backup-method-info |
                            backup-status-info |
                            backup-retention-info |
                            backup-performance-info |
                            restore-full-info |
                            restore-incr-info |
                            replication-info |
                            backup-app-performance-info]
                   [--help]

πŸ¦‹ DESCRIPTION πŸ¦‹

so the mysql-zrm-reporter utility is the one that serves up reports about all your MySQL database backup runs β€” both the pre-defined ones and the user-defined ones you cook up yourself. Those reports can come out in text or HTML format. And plot twist: a backup report can even be sent as an RSS feed. iconic behavior honestly. ✨

You configure your backup reports using the parameters in the /etc/mysql-zrm/mysql-zrm-reporter.conf file. For the supported formats, go peek at mysql-zrm-reporter.conf(5). πŸ“–

The ZRM for MySQL configuration file β€” that's mysql-zrm.conf(5) β€” holds the HTML configuration and RSS feed configuration parameters for the mysql-zrm-reporter utility. Here's the list of mysql-zrm-reporter parameters, no gatekeeping:

  • html-report-directory β€” sets the directory where the text/HTML reports get written. This parameter is optional. Example: /var/www/html/mysql-zrm-reports/
  • html-reports β€” the list of pre-defined report(s) to be generated after a backup run. Example: backup-status-info
  • webserver-url β€” the RSS feeds URL of a directory under the document root of the web server. Heads up: if this value is not specified in the mysql-zrm.conf(5) configuration file, RSS feeds will not be generated. Example: http://backupserver.company.com/reports/
  • rss-header-location β€” the location of the RSS feed properties file, the one containing the RSS feed channel and item properties. This parameter must be provided if webserver-url is specified. Example: /etc/mysql-zrm/RSS.header

πŸ’… BACKUP INFORMATION πŸ’…

Every single backup run generates the following info about the backup. Know your fields, bestie β€” you'll need their names later:

  • backup-date β€” the date and time stamp of the backup run. ⏰
  • mysql-version β€” the MySQL server version.
  • backup-directory β€” the location of the backup directory. πŸ“
  • backup-level β€” lists the backup-level: 0 for a full backup and 1 for an incremental backup.
  • raw-databases β€” the list of databases backed up using mysqlhotcopy. If the raw-tables parameter is present, this will have only one database listed.
  • raw-tables β€” the list of tables backed up using mysqlhotcopy. The name of the database these tables belong to is found under raw-databases.
  • raw-databases-snapshot β€” the list of databases backed up using lvm snapshots. When the raw-tables parameter is specified, this will list only one database.
  • raw-tables-snapshot β€” the list of tables backed up using mysqlhotcopy. The name of the database these tables belong to is found under raw-databases.
  • backup-time β€” the time taken for the complete backup run. Format is HH:MM:SS.
  • read-locks-time β€” the time the read lock was held during the backup run. Format is HH:MM:SS.
  • flush-logs-time β€” the time for flushing database pages to the disk. Format is HH:MM:SS.
  • backup-size β€” the size, in megabytes, of the data backed up.
  • backup-status β€” the status has three values. "Backup Failed" means there was a fatal error. "Backup done with errors" means that even though there was some error during the backup, some of the databases and tables were probably backed up. "Backup succeeded" means the backup run was completed successfully. πŸŽ‰
  • logical-databases β€” the list of databases backed up using mysqldump(1). When the -tables parameter is specified, this will only one database.
  • logical-tables β€” the list of tables belonging to logical-databases backed up using mysqldump(1). The name of the database these tables belong to is found under -databases.
  • replication β€” the list of replication files backed up, namely master.info and relay-log.info.
  • slave-load-files β€” the names of SQL_LOAD* files that were backed up.
  • incremental β€” the names of the binary log files backed up.
  • backup-set β€” the name of the backup set this backup belongs to.
  • comment β€” the comment about the backup added by the administrator in the mysql-zrm.conf(5) file.
  • retention-policy β€” the backup image will be retained for the time specified as a parameter in Days/Weeks/Months/Years. For example: if the value is "10D" that means the backup image will be retained 10 days from the backup-date. Heads up: this policy assumes 365 days in a year and 30 days in a month.
  • compress β€” specifies that the backup was compressed. The default compression method is the gzip program. The program used for compression is the value for this parameter.
  • encrypt β€” the program used for encryption if the backups are encrypted. πŸ”
  • host β€” the hostname of the MySQL server that was backed up.
  • compress-encrypt-time β€” the time taken by compression and/or encryption. Just so you know: this time is included in the backup time.
  • innodb-data β€” the list of InnoDB shared data files backed up.
  • innodb-logs β€” the list of InnoDB logs backed up.

πŸŽ€ OPTIONS πŸŽ€

  • --show backup-method-info | backup-status-info | backup-retention-info | backup-performance-info | restore-info | selective-restore-info | replication-info β€” set this option to display the predefined reports. The predefined reports, and exactly what they contain, are listed below:
    • 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, backup-status, comment
    • selective-restore-info : backup-set, backup-date, incremental
    • replication-info : backup-set, backup-date, replication, slave-load-files
  • --destination dir β€” sets the backup root directory. This parameter is optional. The default value is /var/lib/mysql-zrm.
  • --fields name1,name2,name3... β€” sets the list of backup parameters to display. The list of valid field names is described in the BACKUP INFORMATION section. This field is optional. By default backup-set,backup-date,backup-level,backup-status,comment are displayed. And listen: spaces are not allowed with in the parameter name list. If spaces must be used, the list must be within quotes. πŸ’€
  • --where fieldname=value β€” the utility will display the MySQL backup parameters where the field name matches value. This field is optional.
  • --type html β€” the report will be in HTML format.
  • --output filename β€” the HTML report will be written to filename under the "html" directory, and text reports will be written to filename under the "text" directory. By default, these directories are created under the current working directory. The utility lets users specify an explicit directory location for reports in mysql-zrm.conf(5) using the "html-report-directory" parameter. If this parameter is set, then the utility will create the "html-report-directory" directory (if it does not exist) and the output report with name filename will be written to the "html" and/or "text" sub-directory under the "html-report-directory" path. πŸ—‚οΈ
  • --latest β€” report about the most recent backup run.
  • --noheader β€” generate TEXT reports with no page header. Just so you know, this option will be ignored for HTML reports.
  • --help β€” displays the help message and exits.

🌈 EXAMPLES 🌈

To display backup date, location of backups, and backup set name use:

mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup --fields backup-date,backup-directory,backup-set

To display backup date, backup set name, and size of backup use:

mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup --fields backup-date,backup-set,backup-size

To display size of backup, backup set name, and date of backup for "config1" backup set use:

mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup --fields backup-date, backup-set, backup-size --where backup-set=config1

To display backup status report for "config1" backup set use:

mysql-zrm-reporter --destination /var/lib/mysql-zrm/backup --show backup-status-info --where backup-set=config1

To display backup status report for "config1" backup set in HTML format and write a file use:

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 β€” bestie, this is the folder. Every single bit of your backup data lives under here. All of it. Your whole backup world, chillin' in one directory. πŸ—‚οΈβœ¨
  • /etc/mysql‐zrm/mysql‐zrm‐reporter.conf β€” the config file that the mysql-zrm-reporter utility reads. Yeah, the reporter reads this one, so if something's looking weird, this is your girl. πŸŽ€

😀 RETURN VALUES 😀

Okay so the vibe check on exit codes:

  • On success, zero is returned. Clean. Iconic. No notes. βœ…
  • On error, a non‐zero value is returned. So if your script sees a nonzero, something went sideways, no cap. 🚨

And the output split, which honestly matters so much:

  • Output messages go to STDOUT.
  • Error messages go to STDERR.

So if you're piping stuff around, remember: the good tea is on STDOUT and the messy drama is on STDERR. Keep them separate and you'll never be confused. πŸ’…


🌈 SEE ALSO 🌈

πŸ‘‘ AUTHOR πŸ‘‘

Zmanda Inc. (http://www.zmanda.com) β€” yeah, they made this whole thing. Respect. 🫢


And that's a wrap on mysql‐zrm‐reporter(1), bestie. This page comes to you from the ZRM for MySQL manual, written by Zmanda, Inc., and that footer you'd normally see at the bottom is literally just their name, the manual title and the section number β€” so consider this your cute lil sign-off instead. πŸ’– Go forth, report on those backups, and stay hydrated. πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from