About rsync on linux—used to remote files copying

Written By smart| 12 July 2009| No Comment

rsync – faster, flexible replacement for rcp

rsync is a application for Unix systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate. An important feature of rsync not found in most similar programs/protocols is that the mirroring takes place with only one transmission in each direction. rsync can copy or display directory contents and copy files, optionally using compression and recursion.

Installing rsync onubuntu ,run below code in terminal

$sudo apt-get install rsync

in redhat and other linux centOS

$ yum install rsync

After installing below is the example how to use

Example :

command “rsync

–delete : delete files that don’t exist on sender
-v : Verbose
-e “ssh options” : specify the ssh as remote shell
-a : archive mode
-r : recurse into directories
-z : compress file data

copying files from local to remote server

rsync -v -e ssh /home/user/images username@hostname:/home/user/destinationfolder

here /home/user/images is source path,username@hostname:/home/user/destinationfolder is the destination path

copying files from remote server to local

rsync -v -e ssh username@hostname:/home/user/pics /home/user/images

here username@hostname:/home/user/pics is the source path,/home/user/images is destination path

Related Posts with Thumbnails

Share With Others

Leave your response!




Comment moderation is enabled. Your comment may take some time to appear.