rsync
as a very important tool in a system administrators’ toolbox. It allows to synchronize files and directories and is preferred over cp
by many, especially when operating on a large file base because it allows to resume copying in case it is canceled. But rsync
can do so much more… For example syncing files and folders over SSH, like scp
copies files and folders over SSH but again, with some advantages.
Anyway, here’s how to do. Both systems, the local and the remote system, must have the rsync
package installed. This works for almost any *NIX system.
rsync -avz -e "ssh -p yourSshPortDefaultsTo22" youruser@remoteip:/path/to/files/ /local/path
More information about rsync
can be found in the excellent Arch Linux Wiki: