#9 remove database we don't want to backup

V1.24
open
5
2012-09-11
2011-08-29
georgfly
No

version 1.24.4, php 5.3.5
Maybe i goofed something up in my installation, but i realized that during crondump.pl, mysqldumper always ignored one of my two production-databases from multidump-backup (both databases are not empty).
I think the problem is the code directly underneath "//remove database we don't want to backup" in inc/function.php:
Because if $cron_db_array=$databases['multi'] then we should not use the same array index $k from "foreach ($databases['Name'] as $k=>$v)" to "unset($cron_db_array[$k])..."
anyway, without understanding much about php and mysqldumper's infrastructure i changed code underneath //remove database we don't want to backup to: (hope this makes sense, at least it solved my problem...)

foreach ($databases['Name'] as $k=>$v) {
if (in_array($v, $dontBackupDatabases)) {
foreach($cron_db_array as $kk=>$vv) {
if (in_array($vv, $dontBackupDatabases)){
unset($cron_db_array[$kk]);
}
}
foreach($cron_dbpraefix_array as $kk=>$vv) {
if (in_array($vv, $dontBackupDatabases)){
unset($cron_dbpraefix_array[$kk]);
}
}
foreach($cron_command_before_dump as $kk=>$vv) {
if (in_array($vv, $dontBackupDatabases)){
unset($cron_command_before_dump[$kk]);
}
}
foreach($cron_command_after_dump as $kk=>$vv) {
if (in_array($vv, $dontBackupDatabases)){
unset($cron_command_after_dump[$kk]);
}
}
foreach($newDbNames as $kk=>$vv) {
if (in_array($vv, $dontBackupDatabases)){
unset($newDbNames[$kk]);
}
}

    }
    }

Discussion

  • georgfly
    georgfly
    2011-08-29

    affected file is inc/functions.php, not inc/function.php

     
  • georgfly
    georgfly
    2011-08-29

    $databases['Name'] contains my two production databases, and information_schema.
    $databases['multi'] only contains my two production databases...

     

  • Anonymous
    2011-09-02

    Hi georgfly,

    thanks for your report.
    While we don't continue to develop version 1.24.x but started to create version2 from scratch instead, it wouldn't make sense to invest work here.
    We will keep this in mind. ;)
    But the confusing programmatically handling of databases is just one of the reasons why we started a new version with a new concept. ;)

    Best regards,
    Daniel Schlichtholz