mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-19 00:36:04 +02:00
Added disc-space-checker
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user