This script creates an efficient, encrypted off-site copy of a local directory on a remote server. It combines rsync for delta transfers (only changed blocks travel the network) with ssh as the secure transport. After set -euo pipefail and argument validation, it accepts the local path, an user@host target, the remote destination, and an optional SSH port. The rsync flags do the heavy lifting: -a preserves attributes, -z compresses data in transit, -h prints human-readable sizes, --partial lets interrupted transfers resume instead of restarting, --progress shows live status, and --delete keeps the remote an exact mirror. The custom -e ssh string sets the port and uses accept-new to trust unknown hosts on first contact only. Run it as ./remote_sync.sh /data [email protected] /vol/data 2222. Best paired with SSH key authentication so it can run unattended from cron.