From 26b0061fafb09ec5afa0aa5174d0b948930ca708 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Wed, 3 May 2023 11:40:16 +0200 Subject: [PATCH] Removed pulling status --- .../files/backups-cleanup.py | 6 ------ .../files/pull-remote-backup.sh | 9 +-------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/roles/independent_backups-cleanup-service/files/backups-cleanup.py b/roles/independent_backups-cleanup-service/files/backups-cleanup.py index a61569dc..fad7e6ba 100644 --- a/roles/independent_backups-cleanup-service/files/backups-cleanup.py +++ b/roles/independent_backups-cleanup-service/files/backups-cleanup.py @@ -35,7 +35,6 @@ for host_backup_directory_name in os.listdir(args.backups_folder_path): print_used_disc_space() for version in versions: version_path=os.path.join(versions_directory, version) - version_status_pulling_path=os.path.join(versions_directory, version, ".pulling") print("Checking directory %s ..." % (version_path)) if version == versions[-1]: print("Directory %s contains the last version of the backup. Skipped." % (version_path)) @@ -54,10 +53,5 @@ for host_backup_directory_name in os.listdir(args.backups_folder_path): print("{:6.2f} %% of drive freed".format(difference_percent)) continue - if os.path.exists(version_status_pulling_path): - print("Deleting %s due to unfinished pull." % (version_path)) - shutil.rmtree(version_path) - continue - print_used_disc_space() print("Cleaning up finished.") \ No newline at end of file diff --git a/roles/server_native-backups-consumer/files/pull-remote-backup.sh b/roles/server_native-backups-consumer/files/pull-remote-backup.sh index ab2af05d..ba3dfd55 100644 --- a/roles/server_native-backups-consumer/files/pull-remote-backup.sh +++ b/roles/server_native-backups-consumer/files/pull-remote-backup.sh @@ -45,17 +45,10 @@ for backup_type in $remote_backup_types; do echo "creating local backup destination folder..." && mkdir -vp "$local_backup_destination_path" && - status_pulling_file="$local_backup_destination_path/.pulling" && - echo "creating: $status_pulling_file" && - echo "pulling backup since $(date)" > $status_pulling_file && - echo "starting backup..." && rsync_command='rsync -abP --delete --delete-excluded --rsync-path="sudo rsync" --link-dest="'$local_previous_version_dir'" "'$remote_source_path'" "'$local_backup_destination_path'"' && echo "executing: $rsync_command" && - eval "$rsync_command" && - - echo "removing: $status_pulling_file" && - rm -vf $status_pulling_file || ((errors+=1)); + eval "$rsync_command" || ((errors+=1)); fi done exit $errors;