From 0aaa9f471fbec8dcdfbf4ad89dee2796e31cdf3f Mon Sep 17 00:00:00 2001 From: Mips2648 Date: Mon, 20 Jan 2025 11:50:45 +0100 Subject: [PATCH] fix: do not exclude all folders named "log", this could break plugin installation --- install/backup.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/install/backup.php b/install/backup.php index 43c7225e58..00efd4f7d0 100644 --- a/install/backup.php +++ b/install/backup.php @@ -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 { @@ -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"); @@ -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); } @@ -130,7 +130,7 @@ $excludes = array( 'tmp', - 'log', + './log', 'docs', 'doc', 'tests', @@ -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;