--- /usr/bin/innobackupex.orig 2014-06-12 10:04:20.000000000 +0200 +++ /usr/bin/innobackupex 2014-07-30 09:31:53.935064609 +0200 @@ -2040,6 +2040,24 @@ } } + # stream rsynced files after unlocking + if ($option_rsync && $option_stream) + { + # copy rsynced files to stream + print STDERR "copying to stream after rsync"; + my $rsync_tmpfile_pass2 = "$option_tmpdir/xtrabackup_rsyncfiles_pass2"; + open(RSYNC, "<$rsync_tmpfile_pass2") + || die "Can't open $rsync_tmpfile_pass2 for reading: $!"; + while () { + chomp; + print STDERR "stream after rsync '$backup_dir/$_'\n"; + backup_file_via_stream("$backup_dir", "$_"); + } + close(RSYNC); + unlink "$rsync_tmpfile_pass2" || \ + die "Failed to delete $rsync_tmpfile_pass2: $!"; + } + print STDERR "\n$prefix Backup created in directory '$backup_dir'\n"; if ($mysql_binlog_position) { print STDERR "$prefix MySQL binlog position: $mysql_binlog_position\n"; @@ -3902,9 +3920,9 @@ } } - if ($option_rsync && $option_stream) { - die "--rsync doesn't work with --stream\n"; - } + #if ($option_rsync && $option_stream) { + # die "--rsync doesn't work with --stream\n"; + #} if ($option_decompress) { if (system("which qpress &>/dev/null") >> 8 != 0) { @@ -4169,10 +4187,17 @@ } close(RSYNC); - unlink "$rsync_tmpfile_pass1" || \ + } + + if (!$prep_mode && !$option_no_lock) { + unlink "$rsync_tmpfile_pass1" || \ die "Failed to delete $rsync_tmpfile_pass1: $!"; - unlink "$rsync_tmpfile_pass2" || \ - die "Failed to delete $rsync_tmpfile_pass2: $!"; + + # delete only if --stream is not used, filelist needed later! + if (!$option_stream) { + unlink "$rsync_tmpfile_pass2" || \ + die "Failed to delete $rsync_tmpfile_pass2: $!"; + } } }