Rsync

From Dikapedia
Jump to: navigation, search


rsync - A fast, versattile, remote (and local) file-copying tool. Like SCP, but faster and you can sync.


How to Use Rsync Between Remote and Local Servers


Basic SSH format:

rsync -avpe '[ssh]' [source] [destination@x.x.x.x:/dir/]

To copy from remote server to local host:

rsync -avpe "ssh -i /home/user/.ssh/key" user@lo.cal.i.p:/home/user/file /dir/file

# Example: 
rsync -avpe "ssh -i /home/ardika/.ssh/home_vm_key" ardika@192.168.0.2:/home/ardika/Documents/file /tmp/file

To copy from local host to remote server:

rsync -avpe "ssh -i /home/user/.ssh/key" /home/user/file user@rem.ote.i.p:/home/user/file

# Example:
rsync -avpe "ssh -i /home/ardika/.ssh/aws_key_ardika" /home/ardika/Documents/file ardika@3.83.174.147:/home/ardika/Documents/