=== modified file 'innobackupex-1.5.1' --- innobackupex-1.5.1 2009-07-01 04:42:48 +0000 +++ innobackupex-1.5.1 2009-07-01 20:15:14 +0000 @@ -1821,6 +1821,7 @@ while (defined($database = readdir(DIR))) { my $print_each_file = 0; my $file_c; + my @scp_files; # skip files that are not database directories if ($database eq '.' || $database eq '..') { next; } next unless -d "$source_dir/$database"; @@ -1862,8 +1863,8 @@ system("cp -p '$file' '$backup_dir/$database'") and Die "Failed to copy file '$file': $!"; } elsif ($option_remote_host) { - system("scp $option_scp_opt '$file' '$option_remote_host:$backup_dir/$database/'") - and Die "Failed to scp file '$file': $!"; + # Queue up files for one single scp per database. + push(@scp_files, "'$file'"); } elsif($option_stream eq 'tar') { my $ret = 0; my $file_name = substr($file, rindex($file, '/') + 1); @@ -1876,6 +1877,11 @@ } } } + if ($option_remote_host) { + my $scp_file_list = join(" ", @scp_files); + system("scp $option_scp_opt $scp_file_list '$option_remote_host:$backup_dir/$database/'") + and Die "Failed to scp file '$file': $!"; + } } closedir(DIR);