Monday, 26 November 2012

How to use rsync over ssh for a secure and fast transfer?

rsync is a free utility for unix based systems which can be used to transfer files between remote machine and local machine. It does same work as rcp, but it's much faster than rcp. The logic behind its agility is that it doesn't transfer the whole file or directory, it uses checksum-search algorithm to transfer only the differences.
rsync in itself doesn't offer any security, but when used over ssh, it is best way to transfer files securely and that also faster than other copying utilities.
rsync can be used over ssh or it can be directly connected to rsync daemon running over the remote machine.

NOTE: rsync cannot be used for transfer between two remote hosts.

Now, we will see how to use rsync over ssh to synchronize files or directories between remote and local machine.

To synchronize directory on local machine with that of remote machine

rsync -aervz "ssh -l USER" --delete HOST:REMOTE_DIR LOCAL_DIR

In the same way way, to synchronize a remote directory with a local directory

rsync -aervz "ssh -l USER" --delete LOCAL_DIR HOST:REMOTE_DIR
 
Let's see what all these options are

a : stands for sync in archive mode, i.e. it offers the functionality that archive offers.
e: specifies the shell program used for communication, default is ssh.
r: transfer recursively from directories
v: stands for verbose mode
z: used for compressing the data before transmitting
delete: deletes the extraneous file at receiving side not present in sending side.

For more info visit

1 comment:

  1. A Brief Overview of the New Casino Resort in Harrah's
    Harrah's Resort Atlantic City (“The Pool”) debuted in 2006. 슈어 벳 The 골인 뱃 first 가상 화폐 란 casino 맥스 벳 opened the doors to the public on December 8, 2008. With 22bet a total

    ReplyDelete