Skip to content

Instantly share code, notes, and snippets.

@kamipo
Created January 6, 2011 11:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save kamipo/767765 to your computer and use it in GitHub Desktop.
Save kamipo/767765 to your computer and use it in GitHub Desktop.
innobackupexをtritonnに対応させるよ!
--- innobackupex-1.5.1.org 2010-12-09 23:03:09.000000000 +0900
+++ innobackupex-1.5.1 2011-01-07 01:28:20.000000000 +0900
@@ -1333,10 +1333,19 @@
print FILE "CHANGE MASTER TO MASTER_LOG_FILE='$filename', MASTER_LOG_POS=$position\n";
close(FILE);
+ my $orig_datadir = get_option(\%config, 'mysqld', 'datadir');
+
if ($option_stream eq 'tar') {
+ system("cd $orig_datadir; tar chf - master.info")
+ and Die "Failed to stream 'master.info': $!";
system("cd $option_tmpdir; tar chf - xtrabackup_slave_info")
and Die "Failed to stream 'xtrabackup_slave_info': $!";
unlink $slave_info || Die "Failed to delete '$slave_info': $!";
+ } else {
+ $src_name = escape_path("$orig_datadir/master.info");
+ $dst_name = escape_path("$backup_dir/");
+ system("$CP_CMD \"$src_name\" \"$dst_name\"")
+ and Die "Failed to copy file 'master.info': $!";
}
$mysql_slave_position = "master host '$master', filename '$filename', position $position";
@@ -1989,7 +1998,7 @@
# copy files of this database
opendir(DBDIR, "$source_dir/$database");
- @list = grep(/\.(frm)|(MYD)|(MYI)|(MRG)|(TRG)|(TRN)|(ARM)|(ARZ)|(opt)|(par)$/, readdir(DBDIR));
+ @list = grep(/\.(frm)|(MYD)|(MYI)|(MRG)|(TRG)|(TRN)|(ARM)|(ARZ)|(opt)|(par)|(SEN.*)$/, readdir(DBDIR));
closedir DBDIR;
$file_c = @list;
if ($file_c <= $backup_file_print_limit) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment