티스토리 뷰

Tech/Server ops

rsync setup

niu 2014. 1. 14. 12:31

* rsync setup summary (need root permission)


- rsync service config

- vi /etc/xinetd.d/rsync

service rsync

{

disable = yes no로 설정

......

}


- rsync folder setting

- vi /etc/rsyncd.conf

- http://www.samba.org/ftp/rsync/rsyncd.conf.html

[data]                                        ## name

        path = /home1/user/          ## file path

        comment = user

        uid = user

        gid = user

        use chroot = yes

        read only = yes

        hosts allow = 127.0.0.1, 192.168.10.0/24

        max connections = 5


- service restart

- /etc/init.d/xinetd restart


* rsync iptable setup

- /sbin/iptables -A INPUT -p tcp --dport 873 -j ACCEPT


* ssh

- ssh-keygen -t rsa 로 생성한 key를 server / client 각각 설정

- http://lesstif.com/pages/viewpage.action?pageId=12943452


* rsync sample

- download

rsync -avz -e ssh --delete {serverip}:{rsync folder}/file

rsync -avz -e ssh --delete 192.168.0.1:data/file /home1/download/

rsync -avz -e ssh --delete 192.168.0.1:data/folder/ /home1/download/

댓글