mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-10 15:26:13 +01:00
bug fix: do not initiate site backup if space is full
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user