Results 1 to 2 of 2

Thread: Support exclude-patter for logical backups, exclude information_schema

  1. #1
    Join Date
    May 2013
    Posts
    5

    Default Support exclude-patter for logical backups, exclude information_schema

    This patch enables exclude-pattern to work with logical backups, excludes information_schema by default via enumAllDatabases() (paving the way for excluding performance_schema as well), and cleans up some nearby code.

    Code:
    diff -up MySQL-zrm-3.0/usr/bin/mysql-zrm-backup.exclude MySQL-zrm-3.0/usr/bin/mysql-zrm-backup
    --- MySQL-zrm-3.0/usr/bin/mysql-zrm-backup.exclude      2013-08-26 14:45:36.000000000 -0600
    +++ MySQL-zrm-3.0/usr/bin/mysql-zrm-backup      2014-04-03 17:02:13.648882414 -0600
    @@ -1584,7 +1584,7 @@ sub doLogicalFullBackup()
            &printStartPhase( "Creating logical backup\n" );
         }
         my $params;
    -    my $mydumperparams;
    +    my $mydumperparams = "";
         my $msg = "";
         my $dbs = "";
         my $index_msg = "";
    @@ -1611,15 +1611,9 @@ sub doLogicalFullBackup()
             $index_msg = "logical-databases=".$inputs{"databases"}."\n";
            if($isMyDumper){
                    my @mdbs = split " ", $inputs{"databases"};
    -               my $str ="";
    -               foreach(@mdbs){
    -                       $str.="$_|";
    -               }
    -               $str =~ s/\|$//;
    -               $mydumperparams = "--regex '^(".$str.")'";
    +               $mydumperparams = "--regex '^(".join("|", @mdbs).")'";
             }
         } else {
    -        $params = "--all-databases ";
             @pdbs = &enumAllDatabases();
             if( defined $inputs{"exclude-pattern"} ){
                 my $ln = @pdbs;
    @@ -1629,28 +1623,18 @@ sub doLogicalFullBackup()
                     &printAndDie( "Nothing to backup after exclude-pattern is applied\n" );
                 }
                    # handle the all-databases with ZRM exclude filter
    -            my $str = "";
                 if($isMyDumper){
                     if($ln > $l){
    -                        foreach(@pdbs){
    -                        $str.="$_|";
    -                        }
    -                        $str =~ s/\|$//;
    -                        $mydumperparams = "--regex '^(".$str.")'";
    -                }else{
    -                        $mydumperparams = "";
    +                    $mydumperparams = "--regex '^(".join("|", @pdbs).")'";
                     }
    -           }
    +            }
             }
    +        $params = "--databases @pdbs";
             if( $verbose ){
                 &printLog( "backup of the following databases will be done @pdbs\n" );
             }
    -        $msg = "Logical backup done for the following database(s)\n";
    -        foreach( @pdbs ) {
    -            $dbs = $dbs.$_." ";
    -        }
    -        $msg = $msg.$dbs."\n";
    -        $index_msg = "logical-databases=".$dbs."\n";
    +        $msg = "Logical backup done for the following database(s)\n@pdbs\n";
    +        $index_msg = "logical-databases=@pdbs\n";
         }
         my $ntp = &checkIfNonTrans( @pdbs );
         if($isMyDumper){

  2. #2
    Join Date
    Jul 2018
    Posts
    2

    Default

    orion - it's 2018 and this problem still persists (at least on Debian with version 3.0.0). Thank you very much for this patch, it saved us days of research why our backups have become so large after ZRM upgrade.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •