This commit is contained in:
usmannasir
2024-02-02 21:59:35 +05:00
parent 34b7216a8a
commit b89418a174
2 changed files with 17 additions and 11 deletions

View File

@@ -882,7 +882,10 @@ class ACLManager:
@staticmethod
def CheckStatusFilleLoc(statusFile, domain=None):
TemFilePath = statusFile.split('panel/')[1]
if statusFile.find('panel/') > -1:
TemFilePath = statusFile.split('panel/')[1]
else:
TemFilePath = statusFile.split('tmp/')[1]
try:
value = int(TemFilePath)
@@ -893,11 +896,9 @@ class ACLManager:
#logging.writeToFile(f'value of log file {value}')
if value == f'{domain}_rustic_backup_log':
return 1
return 0
if (statusFile[:18] != "/home/cyberpanel/." or statusFile[:16] == "/home/cyberpanel" or statusFile[
:4] == '/tmp' or statusFile[
if (statusFile[:18] != "/home/cyberpanel/." or statusFile[:16] == "/home/cyberpanel" or statusFile[:4] == '/tmp' or statusFile[
:18] == '/usr/local/CyberCP') \
and statusFile != '/usr/local/CyberCP/CyberCP/settings.py' and statusFile.find(
'..') == -1 and statusFile != '/home/cyberpanel/.my.cnf' and statusFile != '/home/cyberpanel/.bashrc' and statusFile != '/home/cyberpanel/.bash_logout' and statusFile != '/home/cyberpanel/.profile':

View File

@@ -2079,14 +2079,19 @@ def submitBackupCreation(tempStoragePath, backupName, backupPath, backupDomain):
#
# IncScheduler.CalculateAndUpdateDiskUsage()
website = Websites.objects.get(domain=backupDomain)
DiskUsageOfSite = json.loads(website.config)['DiskUsage']
used_disk, free_disk, percent_used = SystemInformation.GetRemainingDiskUsageInMBs()
try:
if float(free_disk) <= float(DiskUsageOfSite):
command = f"echo 'Disk space exceeded the website size. [2065][5009]' > %s"
ProcessUtilities.executioner(command, website.externalApp)
return 0
website = Websites.objects.get(domain=backupDomain)
DiskUsageOfSite = json.loads(website.config)['DiskUsage']
used_disk, free_disk, percent_used = SystemInformation.GetRemainingDiskUsageInMBs()
if float(free_disk) <= float(DiskUsageOfSite):
command = f"echo 'Disk space exceeded the website size. [2065][5009]' > %s"
ProcessUtilities.executioner(command, website.externalApp)
return 0
except:
pass
###