Commit e7e9a525 authored by Falko Timme's avatar Falko Timme
Browse files

- Remove non-existing backups from web_backup table.

parent 29ac6465
......@@ -1194,7 +1194,6 @@ if($backup_dir != '') {
}
$app->system->web_folder_protection($web_path,true);
}
/* If backup_interval is set to none and we have a
......@@ -1296,6 +1295,19 @@ if($backup_dir != '') {
unset($clientdb_password);
}
// remove non-existing backups from database
$backups = $app->db->queryAllRecords("SELECT * FROM web_backup WHERE server_id = ".$conf['server_id']);
if(is_array($backups) && !empty($backups)){
foreach($backups as $backup){
$backup_file = $backup_dir.'/web'.$backup['parent_domain_id'].'/'.$backup['filename'];
if(!is_file($backup_file)){
$sql = "DELETE FROM web_backup WHERE server_id = ".$conf['server_id']." AND parent_domain_id = ".$backup['parent_domain_id']." AND filename = '".$backup['filename']."'";
$app->db->query($sql);
if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql);
}
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment