Pages

Wednesday, September 8, 2010

Rsync Command ::: All Linux Admin Should Know

Recently I came accross rsync utility... Its an awesome command it is a sub service under xinetd along with some other services such as tftp, rcp, rsh, rlogin, telnet etc..

Let us list advantages of this command then we will know how to configure it.

Advantages of rsync :



  1. This tool will keep both the destination and source folder synced.
  2. rsync is fast, because it will not copy entire data every time it got synced, it just copes the date which got changed from previous copy.
  3. For security reasons, rsync will support ssh to transfer data between two machines.
  4. rsync is used to download RPM updated repository to local machine.
And lot more advantages are there.. please share your valuable experiences here.

Configuration : rsync

Some points to be remembered when dealing with rsync

  • This utility is the part of xinetd so there is no special package for this.
  • When we are doing rsync between two systems, both the systems should be configured to allow rsync connections.
  • rsync uses 873.
Step1 : Install xinetd package, if you want to configure yum server click here.
#yum install xinetd

Step2 : Configure rsync to allow connections, the configuration file for rsync is located in /etc/xinetd.d
#cd /etc/xinetd.d
#vi rsync


# default : off
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = yes
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
In this configuration file just change disable = yes to no, then save the file and exit. Here is the updated configured file.
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
disable = no

socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}

Step3 : Start the rsync service, so how to do it? As i mention earlier that rsync is a part of xinetd service so just restart the xinetd service.
#service xinetd restart

Step4 : Permanently on the service
#chkconfig rsync --levels 345 on