mylvmbackup is a completely free and open source script implemented in Perl and designed from the offset to be used by database administrators who want to quickly create backups of the data found on their MySQL servers.
How mylvmbackup works?
It automatically gets a read lock on all database tables, flushes all server caches to a disk drive, creates a LVM (Logical Volume Manager) snapshot of the volume that contains the MySQL data directory, and unlocks the database tables.
Besides Perl (Practical Extraction and Report Language), users will also need to install the DBD::mysql and DBI modules in order to properly use the mylvmbackup script. Additionally, the script also uses the /bin/date, tar, LVM utilities, and the mount and umount system utilities.
The script comes with more command-line options than expected. These can be viewed at a glance by running the ‘mylvmbackup --help’ command in a terminal emulator app. Among the most important ones, we can mention the ability to specify the TCP port, UNIX socket, hostname, username and password for the MySQL server, the action to run (backup or purge), the size of the snapshot volume, as well as the prefix and suffix for naming the backup.
Getting started with mylvmbackup
The good news is that mylvmbackup doesn’t need to be installed in order to use it. Therefore, simply download the source package from Softpedia using the dedicated download button above, save the archive somewhere on your PC, unpack it and run the ‘mylvmbackup’ command.
Add the ‘--help’ argument to the command (e.g. mylvmbackup --help) to view its command-line options (see the section above for details). The bad news is that you will need to install several Perl modules from CPAN to use the script, such as Config::IniFiles, Date::Format, DBD::mysql, File::Copy, and File::Copy::Recursive.
If you want to install the mylvmbackup script system wide and make it available to all users on your system, just run the ‘make install’ command as root or the ‘sudo make install’ command as a privileged user.