Skip to content

Commit 0f89bd9

Browse files
author
Florian Schaal
committed
minor changes for deleting backups when deleting the web-domain
1 parent 2604cb9 commit 0f89bd9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,7 +1984,7 @@ function delete($event_name, $data) {
19841984
$app->services->restartServiceDelayed('httpd', 'reload');
19851985
}
19861986

1987-
//* Remove the web-backups
1987+
//* Delete the web-backups
19881988
if($data['old']['type'] == 'vhost') {
19891989
$server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
19901990
$backup_dir = $server_config['backup_dir'];
@@ -2000,17 +2000,17 @@ function delete($event_name, $data) {
20002000
}
20012001
}
20022002
if($mount_backup){
2003-
//* remove web-archives
20042003
$web_backup_dir = $backup_dir.'/web'.$data_old['domain_id'];
20052004
//** do not use rm -rf $web_backup_dir because database(s) may exits
20062005
exec(escapeshellcmd('rm -f '.$web_backup_dir.'/web'.$data_old['domain_id'].'_').'*');
20072006
//* cleanup database
20082007
$sql = "DELETE FROM web_backup WHERE server_id = ".$conf['server_id']." AND parent_domain_id = ".$data_old['domain_id']." AND filename LIKE 'web".$data_old['domain_id']."_%'";
20092008
$app->db->query($sql);
20102009
if($app->db->dbHost != $app->dbmaster->dbHost) $app->dbmaster->query($sql);
2010+
2011+
$app->log('Deleted the web backup files', LOGLEVEL_DEBUG);
20112012
}
20122013
}
2013-
unset($server_config);
20142014
}
20152015
}
20162016
if($data['old']['type'] != 'vhost') $app->system->web_folder_protection($data['old']['document_root'], true);

0 commit comments

Comments
 (0)