Skip to content

Commit b89418a

Browse files
committed
1 parent 34b7216 commit b89418a

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

plogical/acl.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,10 @@ def CheckDomainBlackList(domain):
882882

883883
@staticmethod
884884
def CheckStatusFilleLoc(statusFile, domain=None):
885-
TemFilePath = statusFile.split('panel/')[1]
885+
if statusFile.find('panel/') > -1:
886+
TemFilePath = statusFile.split('panel/')[1]
887+
else:
888+
TemFilePath = statusFile.split('tmp/')[1]
886889

887890
try:
888891
value = int(TemFilePath)
@@ -893,11 +896,9 @@ def CheckStatusFilleLoc(statusFile, domain=None):
893896
#logging.writeToFile(f'value of log file {value}')
894897
if value == f'{domain}_rustic_backup_log':
895898
return 1
896-
897899
return 0
898900

899-
if (statusFile[:18] != "/home/cyberpanel/." or statusFile[:16] == "/home/cyberpanel" or statusFile[
900-
:4] == '/tmp' or statusFile[
901+
if (statusFile[:18] != "/home/cyberpanel/." or statusFile[:16] == "/home/cyberpanel" or statusFile[:4] == '/tmp' or statusFile[
901902
:18] == '/usr/local/CyberCP') \
902903
and statusFile != '/usr/local/CyberCP/CyberCP/settings.py' and statusFile.find(
903904
'..') == -1 and statusFile != '/home/cyberpanel/.my.cnf' and statusFile != '/home/cyberpanel/.bashrc' and statusFile != '/home/cyberpanel/.bash_logout' and statusFile != '/home/cyberpanel/.profile':

plogical/backupUtilities.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2079,14 +2079,19 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
20792079
#
20802080
# IncScheduler.CalculateAndUpdateDiskUsage()
20812081

2082-
website = Websites.objects.get(domain=backupDomain)
2083-
DiskUsageOfSite = json.loads(website.config)['DiskUsage']
2084-
used_disk, free_disk, percent_used = SystemInformation.GetRemainingDiskUsageInMBs()
2082+
try:
20852083

2086-
if float(free_disk) <= float(DiskUsageOfSite):
2087-
command = f"echo 'Disk space exceeded the website size. [2065][5009]' > %s"
2088-
ProcessUtilities.executioner(command, website.externalApp)
2089-
return 0
2084+
website = Websites.objects.get(domain=backupDomain)
2085+
DiskUsageOfSite = json.loads(website.config)['DiskUsage']
2086+
used_disk, free_disk, percent_used = SystemInformation.GetRemainingDiskUsageInMBs()
2087+
2088+
2089+
if float(free_disk) <= float(DiskUsageOfSite):
2090+
command = f"echo 'Disk space exceeded the website size. [2065][5009]' > %s"
2091+
ProcessUtilities.executioner(command, website.externalApp)
2092+
return 0
2093+
except:
2094+
pass
20902095

20912096
###
20922097

0 commit comments

Comments
 (0)