diff options
author | unknown <iggy@rolltop.ignatz42.dyndns.org> | 2006-07-26 12:36:10 -0400 |
---|---|---|
committer | unknown <iggy@rolltop.ignatz42.dyndns.org> | 2006-07-26 12:36:10 -0400 |
commit | 4672d762ed8c4e372594f5aaff4aea2dd55fa2b1 (patch) | |
tree | cb7218ee2842a9073d677d313554f822512269cb /scripts | |
parent | 30cbba45f8fbfca05f4e87328d281f46cbdbcd59 (diff) | |
download | mariadb-git-4672d762ed8c4e372594f5aaff4aea2dd55fa2b1.tar.gz |
Bug #18777: Mysqlhotcopy does not copy all the direcories.
scripts/mysqlhotcopy.sh:
Defined new raid directory regular expression variable that allows a mix of two alphanumeric characters. Replaced hardcode raid directory regular expressions with new variable.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysqlhotcopy.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh index f9e29e33195..b3ea9dc4035 100644 --- a/scripts/mysqlhotcopy.sh +++ b/scripts/mysqlhotcopy.sh @@ -262,6 +262,7 @@ my $hc_locks = ""; my $hc_tables = ""; my $num_tables = 0; my $num_files = 0; +my $raid_dir_regex = '[A-Za-z0-9]{2}'; foreach my $rdb ( @db_desc ) { my $db = $rdb->{src}; @@ -296,7 +297,7 @@ foreach my $rdb ( @db_desc ) { my @raid_dir = (); while ( defined( my $name = readdir DBDIR ) ) { - if ( $name =~ /^\d\d$/ && -d "$db_dir/$name" ) { + if ( $name =~ /^$raid_dir_regex$/ && -d "$db_dir/$name" ) { push @raid_dir, $name; } else { @@ -604,7 +605,7 @@ sub copy_files { # add recursive option for scp $cp.= " -r" if $^O =~ /m^(solaris|linux|freebsd|darwin)$/ && $method =~ /^scp\b/; - my @non_raid = map { "'$_'" } grep { ! m:/\d{2}/[^/]+$: } @$files; + my @non_raid = map { "'$_'" } grep { ! m:/$raid_dir_regex/[^/]+$: } @$files; # add files to copy and the destination directory safe_system( $cp, @non_raid, "'$target'" ) if (@non_raid); @@ -797,7 +798,7 @@ sub get_raid_dirs { my %dirs = (); foreach my $f ( @$r_files ) { - if ( $f =~ m:^(\d\d)/: ) { + if ( $f =~ m:^($raid_dir_regex)/: ) { $dirs{$1} = 1; } } |