Skip to content

Commit 61c6ce2

Browse files
authored
Merge pull request #3016 from Mips2648/alpha
fix: do not exclude all folders named "log"
2 parents 313e665 + 0aaa9f4 commit 61c6ce2

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

install/backup.php

+9-9
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
}
7878
}
7979

80-
80+
8181
if (isset($CONFIG['db']['unix_socket'])) {
8282
$str_db_connexion = "--socket=" . $CONFIG['db']['unix_socket'] . " --user=" . $CONFIG['db']['username'] . " --password='" . $CONFIG['db']['password'] . "' " . $CONFIG['db']['dbname'];
8383
} else {
@@ -90,14 +90,14 @@
9090
$tables = DB::Prepare("SHOW TABLES", array(), DB::FETCH_TYPE_ALL);
9191
foreach ($tables as $table) {
9292
$table = array_values($table)[0];
93-
if($table == 'event'){
93+
if ($table == 'event') {
9494
continue;
9595
}
96-
echo "Checking table ".$table."...";
97-
system("mysqlcheck " . $str_db_connexion . ' --auto-repair --silent --tables '.$table);
96+
echo "Checking table " . $table . "...";
97+
system("mysqlcheck " . $str_db_connexion . ' --auto-repair --silent --tables ' . $table);
9898
echo "OK" . "\n";
9999
}
100-
100+
101101
echo 'Backing up database...';
102102
if (file_exists($jeedom_dir . "/DB_backup.sql")) {
103103
unlink($jeedom_dir . "/DB_backup.sql");
@@ -109,7 +109,7 @@
109109
throw new Exception('can\'t delete database backup. Check rights');
110110
}
111111
system("mysqldump " . $str_db_connexion . " > " . $jeedom_dir . "/DB_backup.sql", $rc);
112-
112+
113113
if ($rc != 0) {
114114
throw new Exception('Backing up database failed. Check mysqldump installation. Code: ' . $rc);
115115
}
@@ -130,7 +130,7 @@
130130

131131
$excludes = array(
132132
'tmp',
133-
'log',
133+
'./log',
134134
'docs',
135135
'doc',
136136
'tests',
@@ -195,10 +195,10 @@
195195
if ($value['scope']['backup'] === false) {
196196
continue;
197197
}
198-
if (config::byKey($key . '::enable','core',0) == 0) {
198+
if (config::byKey($key . '::enable', 'core', 0) == 0) {
199199
continue;
200200
}
201-
if (config::byKey($key . '::cloudUpload','core',0) == 0) {
201+
if (config::byKey($key . '::cloudUpload', 'core', 0) == 0) {
202202
continue;
203203
}
204204
$class = 'repo_' . $key;

0 commit comments

Comments
 (0)