RSYNC
is one of the most popular File Copying/Synchronizing service among Linux people. Its synchronizing while copping and consume Less network resources for its operations.
CAUTION!!!! Miss use may cause original data overwrite or
deletion.
As an example, here in iPhonik (iPhonik was formed as a company in the business of developing an
Unified Communication Solution product and related services.) we use rsync
to take realtime backups and duplicate them on the redundant servers. Call recording which stores
in the real-time server will be synchronized/ copied to the redundant server (We
are using NFS as the file sharing mechanism share-directory-between-two-server-nfs ).
How to USE
Most of the time your Linux distributions comes with the
installed rsync service but if you don’t have installed rsync on your Linux
distribution,
Debian distributions
RedHat distributionsapt-get install rsync
yum install rsync
Now if you wish to use rsync with the remote host
rsync -avz -e ssh remotepeers@remotedomain:/remotepeers/dirA/dirB/ /local-this-user/dirE/dirF
If you wish to use rsync through server
First you have to setup
rsync as a daemon process, to do that find the /etc/xinetd.con file
and add following lines below the very last line of the file,
rsync stream tcp nowait root /usr/bin/rsync rsync –daemon
Let’s create the rsync
configuration file as “/etc/rsyncd.conf”
And add following
configuration,
max connections = 1
log file = /var/log/rsync.log
timeout = 300
[usersfiles]
comment = Rsync user’s cache
path = /usr/local/
usersfiles
read only = no
list = yes
uid = nobody
gid = nogroup
#auth users = user
list = yes
hosts allow = 127.0.0.0/8 192.168.1.0/24
secrets file = /etc/rsyncd.sec
Save and Exit
By commenting very last two line
will allow anonymous access.
Afterward let’s create the
/etc/rsyncd.sec
file and add user name and
passwords for the allowed users (if you didn’t allow anonymous access).
To start the syncronisation,
rsync -avz
rsync://your_ip-addresses_or_domain/public
Click here for rsync manual (Man page).
Comments
Post a Comment