From b7899214010fbb4938cde2fba0ded4c38b893de6 Mon Sep 17 00:00:00 2001
From: Till Brehm <tbrehm@ispconfig.org>
Date: Sun, 16 Feb 2014 14:54:18 +0100
Subject: [PATCH] Fixed: FS#3222 - Backup cleaner bug

---
 server/cron_daily.php | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/server/cron_daily.php b/server/cron_daily.php
index 9ffd390d1d..a3fb3dacec 100644
--- a/server/cron_daily.php
+++ b/server/cron_daily.php
@@ -1230,6 +1230,9 @@ if($backup_dir != '') {
 					$web_backup_dir = realpath($backup_dir.'/web'.$web_id);
 					if(is_dir($web_backup_dir)) {
 						exec('sudo -u '.escapeshellarg($web_user).' rm -f '.escapeshellarg($web_backup_dir.'/*'));
+						$sql = "DELETE FROM web_backup WHERE server_id = ".intval($conf['server_id'])." AND parent_domain_id = ".intval($web_id);
+						$app->db->query($sql);
+						if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql);
 					}
 				}
 			}
-- 
GitLab