diff --git a/plogical/acl.py b/plogical/acl.py index b41fdbbff..3c0cc24c2 100644 --- a/plogical/acl.py +++ b/plogical/acl.py @@ -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': diff --git a/plogical/backupUtilities.py b/plogical/backupUtilities.py index 6f738e74a..7b3562041 100755 --- a/plogical/backupUtilities.py +++ b/plogical/backupUtilities.py @@ -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 ###