~akopytov/percona-xtrabackup/bug1116177-2.1

« back to all changes in this revision

Viewing changes to innobackupex

  • Committer: Alexey Kopytov
  • Date: 2013-03-22 09:25:00 UTC
  • mfrom: (391.99.1 2.0)
  • Revision ID: akopytov@gmail.com-20130322092500-zoqwpg0u8b1kf067
Manual merge from 2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
# All Rights Reserved.
8
8
#
9
9
 
 
10
use warnings FATAL => 'all';
10
11
use strict;
11
12
use Getopt::Long;
12
13
use File::Spec;
773
774
    print STDERR "$prefix in '$backup_dir'\n";
774
775
    print STDERR "$prefix back to original InnoDB log directory '$orig_iblog_dir'\n";
775
776
    while (defined($file = readdir(DIR))) {
776
 
        if ($file =~ /'^' . $iblog_files . '$'/ && -f "$backup_dir/$file") {
 
777
        if ($file =~ /^$iblog_files$/ && -f "$backup_dir/$file") {
777
778
            $src_name = escape_path("$backup_dir/$file");
778
779
            $dst_name = escape_path("$orig_iblog_dir");
779
780
            &$move_or_copy_file($src_name, $dst_name);
1211
1212
    parse_connection_options(\%con);
1212
1213
 
1213
1214
    $now = current_time();
1214
 
    print STDERR "$now  $prefix Connecting to MySQL server with DSN '" .
1215
 
        $con{dsn} . "' as '" . $con{dsn_user} . "' (using password: ";
 
1215
    print STDERR "$now  $prefix Connecting to MySQL server with DSN '$con{dsn}'" .
 
1216
        (defined($con{dsn_user}) ? " as '$con{dsn_user}' " : "") .
 
1217
        " (using password: ";
1216
1218
    if (defined($con{dsn_password})) {
1217
1219
        print STDERR "YES).\n";
1218
1220
    } else {
1863
1865
        $option_backup = "1";
1864
1866
        $backup_root = $ARGV[0];
1865
1867
        if ($option_incremental && !$option_incremental_lsn) {
1866
 
            my @dirs = `ls -1 -t $backup_root`;
1867
 
            my $inc_dir = $dirs[0];
1868
 
            chomp($inc_dir);
1869
1868
            if ($option_incremental_basedir) {
1870
1869
                $incremental_basedir = $option_incremental_basedir;
1871
1870
            } else {
 
1871
                my @dirs = `ls -t $backup_root`;
 
1872
                my $inc_dir = $dirs[0];
 
1873
                chomp($inc_dir);
1872
1874
                $incremental_basedir = File::Spec->catfile($backup_root, $inc_dir);
1873
1875
            }
1874
1876
        }