Added disc-space-checker

This commit is contained in:
2023-04-16 09:59:54 +02:00
parent 3508baebac
commit 01231cab6b
11 changed files with 75 additions and 2 deletions

View File

@@ -5,7 +5,7 @@ import os
backup_disk_path = "{{backup_disk_path}}"
backups_folder_path = os.path.join(backup_disk_path, "Backups/")
deleted = True
while psutil.disk_usage(backup_disk_path).percent > int({{backup_space_percent}}) and deleted:
while psutil.disk_usage(backup_disk_path).percent > int({{size_percent_maximum_backup}}) and deleted:
deleted = False
print("%d %% of disk %s are used. Freeing space..." % (psutil.disk_usage(backup_disk_path).percent,backup_disk_path))
for primary_directory in os.listdir(backups_folder_path):