Update symlink and remove .inprogress only after success (#264)

This commit is contained in:
qinjunjerry
2023-12-17 19:51:09 +01:00
committed by GitHub
parent 6664e6c5bc
commit 7af3df3644
+4 -1
View File
@@ -613,11 +613,14 @@ while : ; do
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# Add symlink to last backup # Add symlink to last backup
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
if [ "$EXIT_CODE" = 0 ]; then
# Create the latest symlink only when rsync succeeded
fn_rm_file "$DEST_FOLDER/latest" fn_rm_file "$DEST_FOLDER/latest"
fn_ln "$(basename -- "$DEST")" "$DEST_FOLDER/latest" fn_ln "$(basename -- "$DEST")" "$DEST_FOLDER/latest"
# Remove .inprogress file only when rsync succeeded
fn_rm_file "$INPROGRESS_FILE" fn_rm_file "$INPROGRESS_FILE"
fi
exit $EXIT_CODE exit $EXIT_CODE
done done