Copy a File from a Remote Server to a Local Server with SSH
To specify a protocol with rsync you need to give “ -e” option with protocol name you want to use. Here in this example, We will be using “ssh” with “ -e ” option and perform data transfer.
[root@tecmint]# rsync -avzhe ssh firstname.lastname@example.org:/root/install.log /tmp/ email@example.com's password: receiving incremental file list install.log sent 30 bytes received 8.12K bytes 1.48K bytes/sec total size is 30.74K speedup is 3.77
Copy a File from a Local Server to a Remote Server with SSH
[root@tecmint]# rsync -avzhe ssh backup.tar firstname.lastname@example.org:/backups/ email@example.com's password: sending incremental file list backup.tar sent 14.71M bytes received 31 bytes 1.28M bytes/sec total size is 16.18M speedup is 1.10
Copy files from a Remote Server to a Local Server with SSH and exclude file (with dry run)
[root@tecmint]# rsync -avzhe ssh --dry-run --exclude-from '/tmp/exclude.txt' firstname.lastname@example.org:/backups/ /tmp/ email@example.com's password: receiving file list ... done ./ packages sent 515 bytes received 111 bytes 46.37 bytes/sec total size is 12.28K speedup is 19.62