moved some things to common.sh
This commit is contained in:
+4
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user