NOTICE! This is currently a broken partial port from the origal working MySQL specific module. I hope to have the port finished and a functional version uploaded soon. Email me or the list for more information.
The mailing list for the DBA modules is perl-dba@fini.net. See http://lists.fini.net/mailman/listinfo/perl-dba to subscribe.
Uses mysqladmin refresh to flush all logs and tables.
Rotates the binary update, error and any extra mysql logs specified in the conf file. Rotation of binary and error logs is not optional on runs when the databases get backed up. Error and binary logs are kept as incrementals. Other logs are just appended, and are cleared and restarted once over a certain size (as defined in conf).
The mysql error logs don't operate the same way as the other logs. As of mysql 4.0.10, every flush-logs command will cause the error log to rotate to a file with an "-old" suffix attached. This is regardless of the file's size. Mysql shutdown/startup will *not* rotate the error log to the -old file. Any previous -old file is deleted. This function attempts to restore some sanity to how mysql treats the error log. Call this function after the flush-logs command. We will take new -old file and append it to the end of our own file, (different name) and delete the -old file. We'll then call the usual _rotate_generic_log function on it.
Issues command to mysqld to finish writing to the current binary update log and start writing to a new one. We then push all of the bin-logs (except for the newest one) into [dump_dir]/00/. The flush logs command causes mysqld to close the old (already renamed) general query and slow query logs and reopen the logs of the usual file name. It also causes mysqld to flush the binary update log and begin writing to a new binlog file. It does not affect the error log, only a restart of mysqld will start a new error log. The flush hosts command will clean up the hosts cache.
Backup all databases on the server DBMS which are mentioned explicitly or as a pattern in the [included-databases] section in the config file. This function will dump all specified databases to .sql.gz files in the directory [dump_dir]/new/. If there were no errors during backup, _rotate_dump_dirs will then rename it [dump_dir]/00/. If this function encounters errors during backup, the partial dumps to [dump_dir]/new/ will remain until the next time this function is executed. At that time, the contents of [dump_dir]/new/ will be destroyed and new dumps will be placed there. At no time are binary update logs ever placed in [dump_dir]/new/. Return with the number of errors encountered during backup.
DBA::Backup::mysql - MySQL server extension for DBA::Backup
This module is not used directly. It is a server extension for the DBA::Backup module. See the instalation directions for more information.
Original version; created by h2xs 1.23 with options
-ACXn DBA::Backup::mysql
Partially ported from original functional MySQL specific module. Currently broken, but I wanted to get the structure set up and uploaded to CPAN.
Some more work on getting port working and some comments. Early release for boston.pm mailing list.
Improved configuration handling allowing multiple mysql servers. Sample configuration file updated to reflect change. Methods now expect server specific configuration to be passed explicitly and no longer look up in $self->{mysql_server} directly.
Sean Quinlan, <gilant@gmail.com>
Original version by Stefan Dragnev, <dragnev@molbio.mgh.harvard.edu> with contributions from Norbert Kremer, <kremer@molbio.mgh.harvard.edu<gt> and Danny Park, <park@molbio.mgh.harvard.edu.<gt>
Copyright (C) 2004 by Sean P. Quinlan & Stefan Dragnev
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.3 or, at your option, any later version of Perl 5 you may have available.
To install DBA::Backup::mysql, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBA::Backup::mysql
CPAN shell
perl -MCPAN -e shell install DBA::Backup::mysql
For more information on module installation, please visit the detailed CPAN module installation guide.