Skip to content

Commit

Permalink
fix: do not exclude all folders named "log", this could break plugin …
Browse files Browse the repository at this point in the history
…installation
  • Loading branch information
Mips2648 committed Jan 20, 2025
1 parent 313e665 commit 0aaa9f4
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions install/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
}
}


if (isset($CONFIG['db']['unix_socket'])) {
$str_db_connexion = "--socket=" . $CONFIG['db']['unix_socket'] . " --user=" . $CONFIG['db']['username'] . " --password='" . $CONFIG['db']['password'] . "' " . $CONFIG['db']['dbname'];
} else {
Expand All @@ -90,14 +90,14 @@
$tables = DB::Prepare("SHOW TABLES", array(), DB::FETCH_TYPE_ALL);
foreach ($tables as $table) {
$table = array_values($table)[0];
if($table == 'event'){
if ($table == 'event') {
continue;
}
echo "Checking table ".$table."...";
system("mysqlcheck " . $str_db_connexion . ' --auto-repair --silent --tables '.$table);
echo "Checking table " . $table . "...";
system("mysqlcheck " . $str_db_connexion . ' --auto-repair --silent --tables ' . $table);
echo "OK" . "\n";
}

echo 'Backing up database...';
if (file_exists($jeedom_dir . "/DB_backup.sql")) {
unlink($jeedom_dir . "/DB_backup.sql");
Expand All @@ -109,7 +109,7 @@
throw new Exception('can\'t delete database backup. Check rights');
}
system("mysqldump " . $str_db_connexion . " > " . $jeedom_dir . "/DB_backup.sql", $rc);

if ($rc != 0) {
throw new Exception('Backing up database failed. Check mysqldump installation. Code: ' . $rc);
}
Expand All @@ -130,7 +130,7 @@

$excludes = array(
'tmp',
'log',
'./log',
'docs',
'doc',
'tests',
Expand Down Expand Up @@ -195,10 +195,10 @@
if ($value['scope']['backup'] === false) {
continue;
}
if (config::byKey($key . '::enable','core',0) == 0) {
if (config::byKey($key . '::enable', 'core', 0) == 0) {
continue;
}
if (config::byKey($key . '::cloudUpload','core',0) == 0) {
if (config::byKey($key . '::cloudUpload', 'core', 0) == 0) {
continue;
}
$class = 'repo_' . $key;
Expand Down

0 comments on commit 0aaa9f4

Please sign in to comment.