From b0acc1eaec2001e35bccffdbedcb1c1948174d4f Mon Sep 17 00:00:00 2001 From: usmannasir Date: Wed, 18 Sep 2024 11:53:10 +0500 Subject: [PATCH] convert from chttr to quotas --- plogical/IncScheduler.py | 44 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index 720ad6eb4..39daf9504 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -1041,28 +1041,28 @@ def CalculateAndUpdateDiskUsage(): config['DiskUsage'], config['DiskUsagePercentage'] = virtualHostUtilities.getDiskUsage( "/home/" + website.domain, website.package.diskSpace) - if website.package.enforceDiskLimits: - spaceString = f'{website.package.diskSpace}M {website.package.diskSpace}M' - command = f'setquota -u {website.externalApp} {spaceString} 0 0 /' - ProcessUtilities.executioner(command) - if config['DiskUsagePercentage'] >= 100: - command = 'chattr -R +i /home/%s/' % (website.domain) - ProcessUtilities.executioner(command) - - command = 'chattr -R -i /home/%s/logs/' % (website.domain) - ProcessUtilities.executioner(command) - - command = 'chattr -R -i /home/%s/.trash/' % (website.domain) - ProcessUtilities.executioner(command) - - command = 'chattr -R -i /home/%s/backup/' % (website.domain) - ProcessUtilities.executioner(command) - - command = 'chattr -R -i /home/%s/incbackup/' % (website.domain) - ProcessUtilities.executioner(command) - else: - command = 'chattr -R -i /home/%s/' % (website.domain) - ProcessUtilities.executioner(command) + # if website.package.enforceDiskLimits: + # spaceString = f'{website.package.diskSpace}M {website.package.diskSpace}M' + # command = f'setquota -u {website.externalApp} {spaceString} 0 0 /' + # ProcessUtilities.executioner(command) + # if config['DiskUsagePercentage'] >= 100: + # command = 'chattr -R +i /home/%s/' % (website.domain) + # ProcessUtilities.executioner(command) + # + # command = 'chattr -R -i /home/%s/logs/' % (website.domain) + # ProcessUtilities.executioner(command) + # + # command = 'chattr -R -i /home/%s/.trash/' % (website.domain) + # ProcessUtilities.executioner(command) + # + # command = 'chattr -R -i /home/%s/backup/' % (website.domain) + # ProcessUtilities.executioner(command) + # + # command = 'chattr -R -i /home/%s/incbackup/' % (website.domain) + # ProcessUtilities.executioner(command) + # else: + # command = 'chattr -R -i /home/%s/' % (website.domain) + # ProcessUtilities.executioner(command) ## Calculate bw usage