Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync only the target filesystem at the end of mover tasks #1466

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mover-rclone/active.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,5 @@ destination)
error 1 "unknown value for DIRECTION: ${DIRECTION}"
;;
esac
sync
sync -f "${MOUNT_PATH}"
echo "Rclone completed in $(( SECONDS - START_TIME ))s"
2 changes: 1 addition & 1 deletion mover-restic/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ for op in "$@"; do
"restore")
ensure_initialized
do_restore
sync
sync -f "${DATA_DIR}"
;;
*)
error 2 "unknown operation: $op"
Expand Down
6 changes: 5 additions & 1 deletion mover-rsync-tls/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,5 +213,9 @@ fi
wait
echo "Stunnel completed shut down."

sync
if test -b $BLOCK_TARGET; then
sync -f $BLOCK_TARGET
else
sync -f $TARGET
fi
echo "Sync complete, exiting."
4 changes: 3 additions & 1 deletion mover-rsync/destination.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "command=\"/mover-rsync/destination-command.sh\",restrict $(</keys/source.pub)" > ~/.ssh/authorized_keys

MOUNT_PATH="/data"
VOLUME_MODE="filesystem"
if test -b /dev/block; then
VOLUME_MODE=block
MOUNT_PATH="/dev/block"
fi
echo "Destination PVC volumeMode is $VOLUME_MODE"

Expand All @@ -68,6 +70,6 @@ if [[ -e /tmp/exit_code ]]; then
CODE="$CODE_IN"
fi
fi
sync
sync -f "${MOUNT_PATH}"
echo "Exiting... Exit code: $CODE"
exit "$CODE"
1 change: 0 additions & 1 deletion mover-rsync/source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ do
done
set -e
echo "Rsync completed in $(( SECONDS - START_TIME ))s"
sync
if [[ $rc -eq 0 ]]; then
echo "Synchronization completed successfully. Notifying destination..."
# ssh does not take [ip] format for ipv6, so use DESTINATION_ADDRESS rather than URL_DESTINATION_ADDRESS
Expand Down
Loading