Removed pulling status

This commit is contained in:
Kevin Veen-Birkenbach 2023-05-03 11:40:16 +02:00
parent 1b4d726fd0
commit ed43461ef3
2 changed files with 1 additions and 14 deletions

View File

@ -35,7 +35,6 @@ for host_backup_directory_name in os.listdir(args.backups_folder_path):
print_used_disc_space() print_used_disc_space()
for version in versions: for version in versions:
version_path=os.path.join(versions_directory, version) 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)) print("Checking directory %s ..." % (version_path))
if version == versions[-1]: if version == versions[-1]:
print("Directory %s contains the last version of the backup. Skipped." % (version_path)) 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)) print("{:6.2f} %% of drive freed".format(difference_percent))
continue 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_used_disc_space()
print("Cleaning up finished.") print("Cleaning up finished.")

View File

@ -45,17 +45,10 @@ for backup_type in $remote_backup_types; do
echo "creating local backup destination folder..." && echo "creating local backup destination folder..." &&
mkdir -vp "$local_backup_destination_path" && 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..." && 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'"' && 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" && echo "executing: $rsync_command" &&
eval "$rsync_command" && eval "$rsync_command" || ((errors+=1));
echo "removing: $status_pulling_file" &&
rm -vf $status_pulling_file || ((errors+=1));
fi fi
done done
exit $errors; exit $errors;