moved some things to common.sh

This commit is contained in:
2026-04-05 06:39:30 +00:00
parent 1376bf3411
commit 78d2c944c0
4 changed files with 36 additions and 12 deletions
+4 -1
View File
@@ -29,6 +29,7 @@ parse_args "${RAW_ARGS[@]}"
detect_hosts
resolve_remote_ip
check_connectivity
# -----------------------------------------------------------------------------------------------
# Profile resolution — inferred from the directory basename
@@ -74,6 +75,8 @@ START=$(date +%s)
RSYNC_SUCCESS=false
for i in $(seq 1 "$RETRY_COUNT"); do
# dirname "$DIRECTORY" is intentional — rsync recreates the final directory on the remote
# e.g. source /mnt/user/Movies → remote receives /mnt/user/Movies (not /mnt/user/Movies/Movies)
if rsync "${RSYNC_OPTS[@]}" \
-e "ssh -i $SSH_KEY -T -o Compression=no -o IPQoS=throughput" \
"$DIRECTORY" "root@${REMOTE_SERVER}:$(dirname "$DIRECTORY")/"; then
@@ -94,7 +97,7 @@ echo ""
echo "===== SUMMARY ====="
echo "Directory: $DIRECTORY"
echo "Profile: $PROFILE_NAME"
echo "Duration: $((END - START))s"
echo "Duration: $(format_duration $((END - START)))"
if [[ "$RSYNC_SUCCESS" == true ]]; then
echo "Status: $ICON_SUCCESS DONE"
else