Linux | Windows | Email | Security | Database | Network
How to Transfer Files and Folders with Rsync over SSH?
Rsync can be used to transfer files and directories over SSH between systems on the network. The most popular protocols are SSH and FTP. FTP is a popular protocol and SSH is the most secure way to transfer files.
SCP and SFTP are some of the tools that are available to transfer files over SSH, but none of them has all the features that rsync provides. Rsync can be used to mirror, incremental backups, copying files between systems
The following steps show how to transfer files and folders with rsync over SSH protocol.
# rsync –a /opt/<single file> <username>@<IP Address>/<path where you need to copy the file>
# rsync =a /opt/file.zip firstname.lastname@example.org:/var/www
The –an option in the command stands for archive mode and allows you to sync directories recursively, transfer special and block devices, preserve symbolic links, modification time, group, ownership and permission.
Transfer files from remote to local
# rsync -a email@example.com:/var/www/file.zip /opt/
If SSH on your remote server is listening to a port other than the default port 22, we need to specify the custom port with the rsync command
Transferring a large amount of data requires you to monitor the progress. The rsync command in screen mode or with a –P option will show you the progress of the transferred files.
At Velan, our server support engineers can help you to copy a large amount of data from one server to another using rsync command. We troubleshoot problems like these for our clients every day. If you are interested in our service, please fill the Quick connect form to get in touch with us