Make sure xinetd and rsync is available, if not type
# yum -y install rsync xinetd
Add xinetd service to system

# chkconfig –add xinetd
Make sure xinetd running on init 3 and 5
# chkconfig –list xinetd

Enable rsync
# vi /etc/xinetd.d/rsync
Change disable = yes into disable = no
Create username and password for rsync client to use
# vi /etc/rsyncd.secrets
adminname:hispassword

Create configuration and shares for rsync daemon
# vi /etc/rsyncd.conf
max connections = 2
log file = /var/log/rsync.log
timeout = 300

[shares]
comment = shared data stored here
path = /home/adminname/shares
read only = false # chg to true if you want read only 
list = yes
uid = adminname
gid = adminname
auth users = adminname
secrets file = /etc/rsyncd.secrets
hosts allow = 10.10.105.0/24
Secure /etc/rsyncd.*
# chown root.root /etc/rsyncd.*
# chmod 600 /etc/rsyncd.*

Make sure rsync now running
# chkconfig –list
Perhaps you also want to enable port 873 tcp and udp on your firewall so other can connect to your server
–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++–++
rsync command common options

  • –delete : delete files that don’t exist on sender (system)
  • -v : Verbose (try -vv for more detailed information)
  • -e “ssh options” : specify the ssh as remote shell
  • -a : archive mode
  • -r : recurse into directories
  • -z : compress file data
Task : Copy file from a local computer to a remote server
Copy file from /www/backup.tar.gz to a remote server called openbsd.nixcraft.in
$ rsync -v -e ssh /www/backup.tar.gz jerry@openbsd.nixcraft.in:/home/jerry
 
Task : Copy file from a remote server to a local computer
Copy file /home/jerry/webroot.txt from a remote server openbsd.nixcraft.in to a local computer /tmp directory:
$ rsync -v -e ssh jerry@openbsd.nixcraft.in:~/webroot.txt /tmp
 
Task : Synchronize a local directory with a remote directory
$ rsync -r -a -v -e “ssh -l jerry” –delete openbsd.nixcraft.in:/webroot/ /local/webroot
 
Task : Synchronize a remote directory with a local directory
$ rsync -r -a -v -e “ssh -l jerry” –delete /local/webroot openbsd.nixcraft.in:/webroot
 
Task : Synchronize a local directory with a remote rsync server
$ rsync -r -a -v –delete rsync://rsync.nixcraft.in/cvs /home/cvs
 
Task : Mirror a directory between my “old” and “new” web server/ftp
You can mirror a directory between my “old” (my.old.server.com) and “new” web server with the command (assuming that ssh keys are set for password less authentication)
$ rsync -zavrR –delete –links –rsh=”ssh -l vivek” my.old.server.com:/home/lighttpd /home/lighttpd

Comments

comments

SHARE
Previous articleDHCP SERVER
Next articleRAID on Linux