mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-29 16:01:04 +01:00
Removed pulling status
This commit is contained in:
parent
1b4d726fd0
commit
ed43461ef3
@ -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.")
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user