mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-10 06:51:04 +01:00
Changed diffs through versions
This commit is contained in:
parent
3f37ee5c6c
commit
674484eca2
@ -12,14 +12,14 @@ while psutil.disk_usage(backup_disk_path).percent > int({{backup_space_percent}}
|
|||||||
primary_directory = os.path.join(backups_folder_path, primary_directory)
|
primary_directory = os.path.join(backups_folder_path, primary_directory)
|
||||||
for application_directory in os.listdir(primary_directory):
|
for application_directory in os.listdir(primary_directory):
|
||||||
application_directory = os.path.join(primary_directory, application_directory)
|
application_directory = os.path.join(primary_directory, application_directory)
|
||||||
diffs_directory = os.path.join(application_directory, "diffs/")
|
versions_directory = os.path.join(application_directory, "versions/")
|
||||||
diffs = os.listdir(diffs_directory)
|
versions = os.listdir(versions_directory)
|
||||||
diffs.sort(reverse=False)
|
versions.sort(reverse=False)
|
||||||
if len(diffs) >= 1:
|
if len(versions) >= 1:
|
||||||
delete_diff = diffs_directory + diffs[0]
|
delete_diff = versions_directory + versions[0]
|
||||||
print("Deleting %s..." % (delete_diff))
|
print("Deleting %s..." % (delete_diff))
|
||||||
shutil.rmtree(delete_diff)
|
shutil.rmtree(delete_diff)
|
||||||
deleted = True
|
deleted = True
|
||||||
if not deleted:
|
if not deleted:
|
||||||
print("All diffs had been deleted!")
|
print("All versions had been deleted!")
|
||||||
print("Cleaning up finished: %d %% of disk %s are used." % (psutil.disk_usage(backup_disk_path).percent,backup_disk_path))
|
print("Cleaning up finished: %d %% of disk %s are used." % (psutil.disk_usage(backup_disk_path).percent,backup_disk_path))
|
||||||
|
Loading…
Reference in New Issue
Block a user