bug fix: do not initiate site backup if space is full

This commit is contained in:
usmannasir
2024-01-02 13:58:47 +05:00
parent 7d554454f9
commit db3423f537
4 changed files with 57 additions and 26 deletions

View File

@@ -99,6 +99,18 @@ class SystemInformation:
return SystemInfo
@staticmethod
def GetRemainingDiskUsageInMBs():
import psutil
total_disk = psutil.disk_usage('/').total / (1024 * 1024) # Total disk space in MB
used_disk = psutil.disk_usage('/').used / (1024 * 1024) # Used disk space in MB
free_disk = psutil.disk_usage('/').free / (1024 * 1024) # Free disk space in MB
percent_used = psutil.disk_usage('/').percent # Percentage of disk used
return used_disk, free_disk, percent_used
@staticmethod
def populateOLSReport():
SystemInformation.olsReport = open("/tmp/lshttpd/.rtreport", "r").readlines()