mylvmbackup - utility for creating MySQL backups via LVM snapshots

Home page: http://www.lenzg.net/mylvmbackup/
Source code, Bug Reports: https://launchpad.net/mylvmbackup
Maintainer: Lenz Grimmer <lenz@grimmer.com>

mylvmbackup is a Perl script for quickly creating backups of MySQL server's
data files. To perform a backup, mylvmbackup obtains a read lock on all tables
and flushes all server caches to disk, makes an LVM snapshot of the volume
containing the MySQL data directory, and unlocks the tables again. The snapshot
process takes only a small amount of time. When it is done, the server can
continue normal operations, while the actual file backup proceeds.

The LVM snapshot is mounted to a temporary directory and all data is backed
up using the tar program. By default, the archive file is created using a name
of the form backup-YYYYMMDD_hhmmss_mysql.tar.gz, where YYYY, MM, DD, hh, mm,
and ss represent the year, month, day, hour, minute, and second of the time at
which the backup occurred. The prefix backup and the date format can be
modified. The use of timestamped archive names allows you to run mylvmbackup
many times without danger of overwriting old archives.

It is necessary to run mylvmbackup on the same host where the MySQL server
runs. If your MySQL daemon is not listening on localhost, or using the default
socket location, you must specify --host or --socket. Even though mylvmbackup
communicates with the server through a normal client connection to obtain the
read lock and flush data, it makes the backup by accessing the file system
directly. It is also necessary that the MySQL server data directory resides on
an LVM volume. (It is, however, a good idea to do the LVM backup to a different
partition than the one where the data directory resides. Otherwise, there is a
good chance that LVM will run out of undo space for LVM snapshot maintenance
and the backup will fail.)

The user who invokes mylvmbackup must have sufficient filesystem permissions to
create the LVM snapshot and mount it. This includes read/write access to the
backup directory.

Requirements

For proper operation mylvmbackup requires Perl 5 with the 'DBI' and
'DBD::mysql' modules. It also needs the 'Config::IniFiles' to read the global
configuration file of the program and 'Sys::Syslog' in case you want to enable
the syslog log facility. 'Date::Format' is required to create the time stamp
used in the backup file names. In addition, it utilizes 'Getopt::Long' and
'File::Basename' which usually are part of the default Perl distribution.

It also requires several other external programs: GNU 'tar' and 'gzip' to back
up and compress the data, LVM utilities ('lvcreate', 'lvremove' and 'lvs') to
create and remove the LVM snapshot, and the system utilities 'mount' and
'umount'.

Mailing list

If you want to discuss the usage of mylvmbackup, propose patches or ask for
help, there now is a mailinglist, hosted on FreeLists.org. To
subscribe, either enter your email address on the mylvmbackup list
information page at http://www.freelists.org/list/mylvmbackup or send an
email with the subject "subscribe" to mylvmbackup-request@freelists.org.
The list is archived at http://www.freelists.org/archives/mylvmbackup/
