![]() |
Transferring and synchronizing files securely.
Table of Contents [hide]
Notes ∞
- https://web.archive.org/web/20190520205311/https://calomel.org/rsync_tips.html
- https://www.tech-recipes.com/rx/355/
-
https://linoxide.com/rsync-over-ssh-on-different-port-in-linux/ [ 1 ] was https://linoxide.com/linux-command/rsync-over-ssh-on-different-port-in-linux/
All of this assumes you have rsync and SSH on your local computer and remote host. Before beginning, double-check that you can SSH in.
Advanced users could consider other tools, though none have been tested:
Downloading ∞
remote_port=12345 remote_username=your_username remote_server=example.com remote_directory=public_html source="." target="$remote_username"@"$remote_server":"$remote_directory" local_directory="path/to/directory" \cd "$local_directory" \rsync \ --dry-run \ --archive \ --verbose \ --compress \ --delete \ --delete-after \ ` # -p$target_port might be optional for you. ` \ --rsh="ssh -p$remote_port" \ "$source" \ "$target" \ ` # `
Uploading ∞
From your computer to a remote host.
All that's been changed from downloading is to swap the final two items (the source and target)
remote_port=12345 remote_username=your_username remote_server=example.com remote_directory=public_html target="." source="$remote_username"@"$remote_server":"$remote_directory" local_directory="path/to/directory" \cd "$local_directory" \rsync \ --dry-run \ --archive \ --verbose \ --compress \ --delete \ --delete-after \ ` # -p$target_port might be optional for you. ` \ --rsh="ssh -p$remote_port" \ "$source" \ "$target" \ ` # `
Transferring between two remote servers ∞
Advanced users can rsync-ssh between the two servers, but I haven't tested this.
Last updated 2021-03-16 at 13:41:02