2014-09-14 Lenz Grimmer - Merged SNMP support from Alexandre Anriot 2014-09-14 Lenz Grimmer - BUG#1351000: fixed crash when specifying both --help and $mail_report_on was set to 'always' 2014-02-22 Lenz Grimmer - BUG#1283094: The Option "--recoveryopts" did not actually work when provided on the command line. 2014-02-16 Lenz Grimmer - BUG#1095690: The mycnf option now accepts both a file name pointing to an individual my.cnf file as well as a directory name like /etc/mysql to back up an entire configuration directory. The configuration will be stored in a subdirectory -cnf-. - BUG#1269096: Tar output was always verbose, even if quiet option was set. 2014-02-15 Lenz Grimmer - BUG#1186570: Check for the existence of the backup LV and bail out earlier (not when trying to create the LV snapshot) 2013-08-25 Lenz Grimmer - The purge action now only works for tar and local rsync archives (zbackup repos would be corrupted, rsnap does its own retention) 2013-08-08 Korjavin Ivan - Added zbackup backup type 2013-06-11 Lenz Grimmer - Improved error handling: send out an email if mail_report_on has been set to "errors" and a log message with log level LOG_ERR was logged. - Abort and clean up if the snapshot volume could not be mounted - Abort and clean up if the backup creation failed - Exit with a non-zero return code if errorstate was set 2013-06-09 Lenz Grimmer - Enabled timestr() formatting sequences for snapshot volume names, to create snapshot names which contain a dynamic date value. This can be useful when thin provisioned snapshots are used as the actual backup by enabling the keep_snapshot option 2013-06-03 Lenz Grimmer - Added "thin" option to mylvmbackup.conf (default=0), to enable thin provisioned LVM snapshots 2013-06-01 Lenz Grimmer - Added new configuration option "recoveryopts" that allows to modify the command line options that are passed to the MySQL instance that performs the InnoDB recovery (BUG#544295 and BUG#1091950) The current default options are "--skip-networking --skip-grant --bootstrap --skip-syslog --skip-slave-start" (which better accommodates MySQL 5.1) 2013-05-30 Lenz Grimmer - Merged patches from Alexandre Anriot to provide a mail reporting method which sends the log output via email and a new "purge" action that allows to only keep a defined number of backups in the backup directory 2013-03-31 Lenz Grimmer - Applied patch contributed by Klaus Ethgen that removes the annoying LVM warnings about a leaked file descriptor (DBD:mysql does not add FD_CLOEXEC on the MySQL socket) 2012-12-16 Lenz Grimmer - BUG#1086313: mvlvmbackup lacks support for 'thin' LVM snapshots (Thanks to Neil Wilson for the patch) 2011-11-24 Lenz Grimmer - BUG#787063: Ensure to clean up temporary .pos files when the snapshot mount is kept, too 2011-02-14 Lenz Grimmer - Applied small patch from Norbert Tretkowski: change umask to 077 before creating the tarball backup files to prevent them from being readable by everyone 2010-09-21 Lenz Grimmer - BUG#593220: Fixed the compressarg option for cat (removed the comment) 2010-09-09 Lenz Grimmer - Applied patch contributed by Ben Bonnel to add a new configuration option "rsnaprsyncarg" that allows one to pass special options to the rsync process when using the rsnap backend. 2010-01-09 Lenz Grimmer - Applied patch provided by Ask Bjørn Hansen to allow targets not to have a timestamp (e.g. for rsync targets) 2009-09-06 Lenz Grimmer - Bumped up version number to 0.14 2009-07-02 Lenz Grimmer - Deleted sample precleanup.pm hook as it has potential to cause harm and is too specialized on a particular use case (BUG#394668) 2009-06-26 Lenz Grimmer - Added support for rsync via SSH (BUG#392462) - Fixed InnoDB recovery in case a relative path to the MySQL data directory is defined (BUG#38337), improved the documentation of relpath in the man page. 2009-06-20 Lenz Grimmer - Bumped up version number to 0.13 2009-06-18 Lenz Grimmer - Fixed allowed format strings for timestamped backupdir and mountdir directory names - Updated documentation: added information about hooks as Perl modules, added new logerr hook to the list of available hooks, use of format strings for the backupdir and mountdir. Documented the fact that these directories are now created automatically, if they don't exist. - Fixed Makefile and RPM spec file to install Perl hooks (and include them in the distribution) - Removed the absolute path names to external tools, as they tend to differ between Linux distributions - ensure to configure $PATH correctly instead - Added --log-err to the startup options of the InnoDB recovery instance to redirect logging output to $TMP/mylvmbackup_recoverserver.err (instead of using the primary instance's error log file, in case it has been defined in my.cnf) 2009-06-14 Lenz Grimmer - Merged contributions from Matthew Boehm: - Added support for date/time formatted file paths for the backupdir and mountdir. Example: $backupdir=/path/to/%Y/%m/%d will expand to /path/to/2008/10/02 and backups will go in there. - Added support to attempt to create $backupdir and $mountdir if they do not exist. - Added support for using Perl modules as hook scripts. Module must be named .pm and must be a package of type . Module must implement ->execute() which is called by mylvmbackup to initiate the hook. It must return boolean true/false (1 or 0) on success/failure. ->execute() will be passed 2 parameters. The first parameter is a clone() of the global $dbh. This will allow hook scripts to perform actions on the DB using the existing connection. The second parameter is a string containing any messages passed to the run_hook() function. Module must also implement ->errmsg() which will return a string error message to be sent to log_msg(). This will be called by mylvmbackup when ->execute() returns false/0. - Added new hook, 'logerr'. Called by log_msg() when log severity is LOG_ERR. Passes $msg to hook script. 2009-06-13 Lenz Grimmer - Removed the bind mount of the position file directory: copy the config files (position record and my.cnf) into the writable snapshot directly - Fixed the backup backends to honor this change, fixed the rsnap plugin to actually include the config files as well - Removed some hardcoded /tmp paths with a $TMP variable - Removed superflous $lvm_version variable 2009-06-07 Lenz Grimmer - Made Linux LVMv2 a requirement 2009-05-07 Lenz Grimmer - Applied patch by Tim Stoop: added option --keep_mount which keeps the snapshot mounted after the mylvmbackup run (which also implies --keep_snapshot) 2009-03-02 Lenz Grimmer - Updated all URL references to point to lenzg.net instead of lenzg.org - Applied small patch from Baron Schwartz to allow reading from ~/.my.cnf 2008-12-17 Lenz Grimmer - Added project home page URL to the --help output, added note about the existence of a sample config file to the man page - Add build date to the version string in the help output - Fixed check for backupdir to not require it when using rsync to a remote server or when not doing any backups with backuptype=none (Thanks to Ronald Bradford for these suggestions) 2008-11-23 Lenz Grimmer - Added new option "--quiet" that suppresses informal logging output (warnings and errors will still be printed/logged) - Small fixes to kjetilho's patch 2008-11-20 Lenz Grimmer - Applied patch from "kjetilho" that makes mylvmbackup more robust and paranoid when it comes to handling errors/failures (Bug #298175) Now the script aborts cleanly in case of any error. 2008-10-22 Lenz Grimmer - Fixed error handling in case of a failed DB connection (patch submitted by Matthew Boehm, Bug #280989) - Merged changes from Alexander Skwar: Fix for Bug #278478 and implemented Blueprint "Improve the tar backup backend of mylvmbackup" 2008-10-01 Lenz Grimmer - Fixed Bug #271671: "overloading parameters does not work" by removing the default values for host and port from the configuration file and removing the unnecessary check for passing both host and socket at the same time. Updated documentation and configuration file comments accordingly. - Applied patch suggested by "Jonas" to fix Bug #267944: "backup returns successfully when snapshot creation fails" - Code cleanup: moved flushing of tables in a separate subroutine flush_tables() - Code cleanup: moved log messages into the respective subroutines - Code cleanup: use return values of subroutines instead of updating global variables - Improved some log messages to explain what was DONE or FAILED - Code cleanup: build up long command strings in a $command variable before passing it to system() - Renamed subroutine create_snapshot() to create_lvm_snapshot() 2008-09-25 Lenz Grimmer - Merged patch from Matthew Boehm: Removed old asciidoc documentation in favor of POD style. This removes the dependency on the external program a2x for creating documentation and uses the 'built-in' pod2html and pod2man instead. Updated the Makefile to accommodate the change. 2008-09-24 Lenz Grimmer - Applied patch from Matthew Boehm to make the backup file name suffix configurable via a "--suffix" option. Updated the man page accordingly. 2008-09-23 Lenz Grimmer - Bumped up version number to 0.11 - Applied patch from Matt Lohier to support rsnap as a backup backend - Updated man page - Moved the list of contributors from the man page into a separate CREDITS file, added missing names - Updated the RPM spec file to include CREDITS 2008-09-03 Lenz Grimmer - Applied patch from Marc Haber: added option "--keep_snapshot" that will skip the removal of the backup snapshot before terminating the script. Providing the option "--backuptype=none" will now skip creating a backup using the builtin backup modules. Both options provide more flexibility when using hooks for performing the actual backup tasks. - Added two new hooks: "backupsuccess" and "backupfailure" which are called respectively upon success of failure of the backup operation (Bug #264089) - Updated documentation 2008-07-18 Lenz Grimmer - Make sure that binaries are being found ($PATH may not include /sbin when called from cron), added missing entry for "lvs" to mylvmbackup.conf (Bug #255703) 2008-07-10 Lenz Grimmer - Applied patch from Patrick Hahn: provide an option to call external scripts/applications (hooks) at various stages of the backup process. See the man page for instructions - Added options "--skip_hooks" to disable the execution of hooks and "--hooksdir" to define the location for these (default is /usr/share/mylvmbackup) - Updated documentation: added new options and instructions on how to use hooks - Updated TODO 2008-07-09 Lenz Grimmer - Applied patch from Robin H. Johnson: Full support for an rsync:// service as the backup destination. If you include any path fragments with the rsync module name, they must already exist! - Updated documentation to reflect this change 2008-06-25 Lenz Grimmer - The mylvmbackup source tree was moved from Subversion to Bazaar and is now hosted on Launchpad.net: 2008-04-10 Lenz Grimmer - Bumped up version number to 0.9 2008-04-09 Lenz Grimmer - Fixed a bug in the InnoDB recovery function: the second mysqld process clobbered the socket file of the primary MySQL instance (thanks to Alain Hoang for reporting this) - Updated the man page, noted some other limitations of the InnoDB recovery function 2008-04-04 Lenz Grimmer - Bumped up version number to 0.8 2008-03-03 Lenz Grimmer - Bug fix: use the correct mysqld parameter to provide an alternative PID file (--pid-file instead of --pidfile) - thanks to Guillaume Boddaert and Jim Wilson for reporting this! - Added option "--skip_mycnf" to skip including a copy of the MySQL configuration file in the backup, added a safety check that the file actually exists prior to backing it up. 2007-10-27 Lenz Grimmer - Bumped up version number to 0.7 2007-10-27 Lenz Grimmer - Use mktemp/mkdtemp to generate the random temporary file/directory names 2007-10-27 Robin H. Johnson - Add rsync backup type. This is very useful if you want to use mylvmbackup to create the initial state for your slave servers. - Shrink the --help output by only listing common options, and referring the user to the manpage for further information. 2007-10-20 Robin H. Johnson - Add support for a trailing argument to tar, can be used for excluding files. - Clean up variable ordering and manpage to ensure that all arguments/configopts are documented. - Do not start NDB or a replication slave when performing InnoDB recovery - Separate out the suffix of the tarball (Preparation for rsync and users that want to use bzip2 or no compression.) - Use a temporary suffix at the end of the tar backup file to indicate that it is incomplete. - Applied patch from Robin H. Johnson: Include the my.cnf file in the backup. (TODO: make this optional and check for the existence of the file before copying it) - Add the ability to run an extra FLUSH TABLES for busy databases where lvcreate might take a long time (and may overrun the interactivity timeout on the connection, losing the lock). 2007-09-13 Lenz Grimmer - Added option "--pidfile" to provide an alternative PID file location for the second server instance that is started to perform the InnoDB recovery on the snapshot prior to backing it up (Otherwise it may default to using the same pid file location that the running server uses and safe_mysqld will abort) - thanks to Kristian Köhntopp for making me aware of this problem - Before discarding the snapshot LV, the output of "lvs " is now printed out for diagnostics. It contains useful information like "how much percent of the backing store was used, which helps tuning the size of the snapshot LV. - Updated the man page, documented the new pidfile option and added a section with general hints 2007-07-03 Lenz Grimmer - Added option "--skip-flush-tables" that performs the snapshot without flushing the tables to disk beforehand (which is not supported by InnoDB tables anyway) - this would save time, as the flushing can take some time, depending on the buffer sizes. (Thanks to Peter Zaitsev for the suggestion) 2007-05-31 Lenz Grimmer - Bumped up version number to 0.6 - Updated man page and README to list all required Perl modules (thanks to Scott Kaminiski for pointing this out) - Replaced the call to the external /bin/date binary for creating the timestamp string with a builtin function (using Date::Format) 2007-05-07 Lenz Grimmer - Bumped up version number to 0.5 - Slightly reworked Eric's patch and performed some minor code cleanup - Documented the InnoDB recovery option in the man page 2007-04-12 Eric Bergen - Added Option "--innodb-recover", which provides an option to run InnoDB recovery on LVM2 snapshots (which provide write access to the device) prior to creating the backup archive. This speeds up resuming a MySQL instance from a restored backup. Also fixed a bug with the default value handling for command line options. In version 0.4 if a config file was specified default values in the script were all changed to blank. This means that the config file had to supply values for every variable instead of just the values that need to be changed from default. 2007-01-14 Lenz Grimmer - Bumped up version number to 0.4 - Fixed DSN string handling (thanks to Peter Zaitsev for spotting this) - removed a few unused configuration options from the config file (we can re-add them once they are really used) - Slightly cleaned up Robin's changes, updated the man page and help output - Fixed logging to the console (log levels were not printed) 2007-01-12 Robin H. Johnson - Clean up option handling to load the defaults, followed by the default configuration file, followed by an alternative configuration file (specified via CLI arguments), followed by the remainder of the CLI arguments. - Do cleanups on directory inputs for spaces and trailing slashes. - Enforce a non-empty prefix at all times. - Change the capture of the position file and tarball creation to not use absolute paths, and instead use them relative to $mountdir. - Utilize a bindmount to get the position directory near the $mountdir for the tarball creation. - 'use vars' has been deprecated by upstream way back in Perl-5.6.0 http://perldoc.perl.org/vars.html, use 'my' instead. 2006-11-24 Lenz Grimmer - Cleaned up Fred's patch a bit: added --help output and corrected the option handling. Provide sane default values when no option file is used. - Only require SyS::Syslog if we actually use syslog for logging (less Perl module dependencies) - Slightly beefed up the console logging by printing a time stamp in front of the message and display "Info/Warning/Error/" according to the log level. - Removed syslog_ident and syslog_args from the command line options and config file (these remain hardcoded) - added check for hostname, if remote logging is requested - Updated and reformatted the help output - Changed the name of the default logging from "standard" to "console" - Added descriptions of the new logging options to the man page - Released as version 0.3 2006-11-23 Fred Blaise - Added functionality to use syslog for logging activity. This requires the Sys::Syslog Perl module. - Bugfix: in GetOptions, tar and umount were pointing to the mount binary. - Do not append a '/' to $mountdir if $prefix is empty. - Bugfix: Corrected variable 'date_format' back to 'datefmt' - Bugfix: Removed tailing slash for backupdir and mountdir in config file to avoid resulting double slash with unused variable - Bugfix: Fixed wrong section assignation of $prefix (misc, instead of lvm), which resulted in uninitialized value. 2006-11-23 Lenz Grimmer - slightly cleaned up Fred's patch, reverted using the previous default values and match the variables used in the config file with the command line options - Updated TODO (supporting external config files is done, thanks) - bumped up version number to 0.3 - Added installing of the config file to the Makefile - Changed the default LVM snapshot size from 10M to 5G to match the defaults - Added the config file to the RPM file list - Changed the script to still work without the configfile, falling back to builtin defaults (to revert the previous behavior). - Started converting the man page to asciidoc for easier maintenance and more possibilities to convert to other formats like HTML or DocBook. - Renamed the man page input file, added man page building with a2x to the Makefile 2006-11-22 Fred Blaise - Added initial support for using an external /etc/mylvmbackup.conf configuration file (requiring the Config::IniFiles Perl module) 2006-11-21 Lenz Grimmer - Removed the START/STOP SLAVE calls (They cause problems where the box isn't a slave, and don't actually help anything where the box is a slave) - thanks to Robin H. Johnson for reporting this and Fred Blaise for verifying it. 2006-11-15 Lenz Grimmer - Added Makefile to perform various build and installation tasks - Renamed the mylvmbackup source file to mylvmbackup.pl.in, which is turned into the mylvmbackup executable by the Makefile - Added RPM spec file to build RPM packages - Updated Version to 0.2 (now defined in the Makefile) - Updated INSTALL file, now one can run "make install" instead of manually copying the files - Updated TODO list - Released as version 0.2 2006-11-14 Lenz Grimmer - Documented Robin's changes in the man page, cleaned up the man page in general - Added new option: 'datefmt' that allows one to define the format of the date time stamp in the backup file name 2006-11-12 Robin H. Johnson - General cleanup, intended to make mylvmbackup usable for distributions. - Add --xfs to help with using XFS snapshots (adds nouuid per LVM HOWTO) - Support for relative paths within the datadir LV. - Sane default locations for the snapshot mount point and the backup directory. Distributions should create /var/tmp/mylvmbackup/mnt/ and /var/tmp/mylvmbackup/backup/ on installation of mylvmbackup. - Add a prefix name for backups, to enable multiple parallel backups. - Add host/port/socket support for connecting to MySQL properly. - Give a little more output during the backup process. - Change the position file format to be a key/value pair style. - Capture the slave and master status during position capture. - Hidden option: 'tararg' to override the default 'cvzf' parameter to tar. - Hidden option: 'backuplv' to control the name of the snapshot LV. 2006-05-05 Lenz Grimmer - Initial version 0.1 - Moved out of the internal BK repository, added GPL license and additional info