You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/lib/classes/backup.inc.php
+53-31Lines changed: 53 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -721,7 +721,7 @@ protected static function clearBackups($server_id, $web_id, $max_backup_copies,
721
721
}
722
722
723
723
/**
724
-
* Garbage collection: deletes records from database about files that do not exist and deletes untracked files.
724
+
* Garbage collection: deletes records from database about files that do not exist and deletes untracked files and cleans up backup download directories.
725
725
* The backup directory must be mounted before calling this method.
726
726
* @param int $server_id
727
727
* @param string|null $backup_type if defined then process only backups of this type
@@ -740,25 +740,32 @@ protected static function backups_garbage_collection($server_id, $backup_type =
740
740
$backup_dir = trim($server_config['backup_dir']);
741
741
$sql = "SELECT * FROM web_backup WHERE server_id = ?";
742
742
$sql_domains = "SELECT domain_id,document_root,system_user,system_group,backup_interval FROM web_domain WHERE server_id = ? AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias')";
743
+
$sql_domains_with_backups = "SELECT domain_id,document_root,system_user,system_group,backup_interval FROM web_domain WHERE domain_id in (SELECT * FROM web_backup WHERE server_id = ?" . ((!empty($backup_type)) ? " AND backup_type = ?" : "") . ") AND (type = 'vhost' OR type = 'vhostsubdomain' OR type = 'vhostalias')";
@@ -1460,7 +1482,7 @@ public static function run_all_backups($server_id, $backup_job = "auto")
1460
1482
}
1461
1483
}
1462
1484
1463
-
$sql = "SELECT DISTINCT d.*, db.server_id as `server_id` FROM web_database as db INNER JOIN web_domain as d ON (d.domain_id = db.parent_domain_id) WHERE db.server_id = ? AND db.active = 'y' AND d.backup_interval != 'none' AND d.backup_interval != ''";
1485
+
$sql = "SELECT DISTINCT d.*, db.server_id as `server_id` FROM web_database as db INNER JOIN web_domain as d ON (d.domain_id = db.parent_domain_id) WHERE db.server_id = ? AND db.active = 'y' AND d.backup_interval != 'none' AND d.backup_interval != ''";
0 commit comments