From 5f8902782d41b91a78ab5d451dca4dc0733b3feb Mon Sep 17 00:00:00 2001 From: "Kevin Veen-Birkenbach [aka. Frantz]" Date: Mon, 28 Mar 2022 18:22:03 +0200 Subject: [PATCH] Changed diffs through versions --- .../templates/backups-cleanup.py.j2 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/native-backups-cleanup/templates/backups-cleanup.py.j2 b/roles/native-backups-cleanup/templates/backups-cleanup.py.j2 index b3a80c8c..fb5c27ec 100644 --- a/roles/native-backups-cleanup/templates/backups-cleanup.py.j2 +++ b/roles/native-backups-cleanup/templates/backups-cleanup.py.j2 @@ -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) for application_directory in os.listdir(primary_directory): application_directory = os.path.join(primary_directory, application_directory) - diffs_directory = os.path.join(application_directory, "diffs/") - diffs = os.listdir(diffs_directory) - diffs.sort(reverse=False) - if len(diffs) >= 1: - delete_diff = diffs_directory + diffs[0] + versions_directory = os.path.join(application_directory, "versions/") + versions = os.listdir(versions_directory) + versions.sort(reverse=False) + if len(versions) >= 1: + delete_diff = versions_directory + versions[0] print("Deleting %s..." % (delete_diff)) shutil.rmtree(delete_diff) deleted = True 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))