Skip to content

Commit

Permalink
convert from chttr to quotas
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Sep 18, 2024
1 parent 0864350 commit b0acc1e
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions plogical/IncScheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b0acc1e

Please sign in to comment.