remove more aps/autoresponder/backup stuff
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -28,7 +28,7 @@ if (isset($argv[1]) && strtolower($argv[1]) == '--help') {
|
||||
echo "\n*** Froxlor Master Cronjob ***\n\n";
|
||||
echo "Below are possible parameters for this file\n\n";
|
||||
echo "--force\t\t\tforces re-generating of config-files (webserver, etc.)\n";
|
||||
echo "--force-[cronname]\tforces the given cron to run, e.g. --force-backup, --force-traffic\n\n";
|
||||
echo "--force-[cronname]\tforces the given cron to run, e.g. --force-mailboxsize, --force-traffic\n\n";
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -168,11 +168,9 @@ while ($row = $result_tasks_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
*/
|
||||
elseif ($row['type'] == '5') {
|
||||
$cronlog->logAction(CRON_ACTION, LOG_INFO, 'Creating new FTP-home');
|
||||
// FIXME %_backup clause not necessary after backup-feature is being removed
|
||||
$result_directories_stmt = Database::query("
|
||||
SELECT `f`.`homedir`, `f`.`uid`, `f`.`gid`, `c`.`documentroot` AS `customerroot`
|
||||
FROM `" . TABLE_FTP_USERS . "` `f` LEFT JOIN `" . TABLE_PANEL_CUSTOMERS . "` `c` USING (`customerid`)
|
||||
WHERE `f`.`username` NOT LIKE '%_backup'
|
||||
");
|
||||
|
||||
while ($directory = $result_directories_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
@@ -200,20 +198,7 @@ while ($row = $result_tasks_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: rm -rf ' . escapeshellarg($homedir));
|
||||
safe_exec('rm -rf '.escapeshellarg($homedir));
|
||||
}
|
||||
|
||||
// remove backup dir
|
||||
// FIXME remove when backup-feature has been removed
|
||||
$backupdir = makeCorrectDir($settings['system']['backup_dir'] . $row['data']['loginname']);
|
||||
|
||||
if (file_exists($backupdir)
|
||||
&& $backupdir != '/'
|
||||
&& $backupdir != $settings['system']['backup_dir']
|
||||
&& substr($backupdir, 0, strlen($settings['system']['backup_dir'])) == $settings['system']['backup_dir']
|
||||
) {
|
||||
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: rm -rf ' . escapeshellarg($backupdir));
|
||||
safe_exec('rm -rf '.escapeshellarg($backupdir));
|
||||
}
|
||||
|
||||
// remove maildir
|
||||
$maildir = makeCorrectDir($settings['system']['vmail_homedir'] . '/' . $row['data']['loginname']);
|
||||
|
||||
|
||||
@@ -409,14 +409,7 @@ while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||
/**
|
||||
* Total Usage
|
||||
*/
|
||||
if ($settings['system']['backup_count'] == 0
|
||||
&& file_exists($settings['system']['backup_dir'] . $row['loginname'])
|
||||
) {
|
||||
$backupsize = exec('du -s ' . escapeshellarg($settings['system']['backup_dir']) . $row['loginname'] . '');
|
||||
$diskusage = floatval($webspaceusage + $emailusage + $mysqlusage - $backupsize);
|
||||
} else {
|
||||
$diskusage = floatval($webspaceusage + $emailusage + $mysqlusage);
|
||||
}
|
||||
$diskusage = floatval($webspaceusage + $emailusage + $mysqlusage);
|
||||
|
||||
$upd_data = array(
|
||||
'diskspace' => $current_diskspace['all'],
|
||||
|
||||
Reference in New Issue
Block a user