SELinux -> disabled


yum install rsync 설치 후 rsync 포트번호 확인

vi /etc/services

==rsync 873/tcp

==rsync 873/udp


rsync 서버 사용 설정

#vi /etc/xinetd.d/rsync

disable = no


# vi /etc/rsyncd.conf

/etc/rsyncd.conf의 경우 처음에는 없는 파일일 가능성이 높다. 편집기를 이용해 새로 작성해준다.

====================================================

[test]                                 -> 사용할 rsync 서비스 이름

path=/data/test/                  -> 데이터 원본 경로

icomment = test                   -> 코멘트

uid = root                                       -> 권한 사용자

gid = root                                       -> 권한 그룹

use chroot = yes  

read only = yes

hosts allow = 192.168.0.201     -> rsync 클라이언트 IP , local일 경우 입렵 필요 없음

max connections = 3   -> 최대 연결 수

timeout=600


xinetd 서비스 재시작

# /etc/init.d/xinetd restart


rsync client 설정

====================================================

# telnet [rsync 서버 IP] 873

ex) telnet 192.168.1.200 873        rsync 접속 여부 확인

# rsync -avz [IP]::[서비스명] [저장디렉토리]

ex) # rsync -avz 192.168.1.200::test /data/test

혹시 내역을 로그로 남기고 싶을 경우 아래와 같이 입력한다.

# rsync -avz 192.168.1.200::test /data/test > /data/test/rsync.log

====================================================

데이터 동기화 시 crontab 사용 (client server에서 설정)

====================================================

#crontab -e

편집창에 아래와 같이 입력(매분 마다 동기화)

* * * * * rsync -avz 192.168.1.200::test  /data/test

====================================================

Linux = Client <-> Window = Server


Server 설정

1. 윈도우에 cwRsyncServer_4.1.0_Installer 설치

2. 방화벽 해제

3. 인바운드에 새 규칙 추가

4. 설정파일 세팅

use chroot = false

strict modes = false

hosts allow = *

log file = rsyncd.log


# Module definitions

# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work

#

[test]

path = /cygdrive/d/rsyncbackup          cygdrive 포팅

read only = false

hosts allow = 10.10.30.28            client ip를 적어야하지만 virtualbox 이용관계로 server ip 입력

transfer logging = yes

UID = 0

GID = 0


Client 설정

1. 설정파일 수정

2. 공유하고자 하는 디렉토리 앞으로 경로 이동

3. rsync -avr --delete data/ 10.10.30.28::test

                       공유폴더  서버ip   

'Server - Linux' 카테고리의 다른 글

[SVN]  (0) 2016.07.04
[snmp] (Linux-client) 설정  (0) 2016.07.04
[iptables] 웹서버 방화벽 iptables 실습 (22, 80 Accept)  (0) 2016.07.04
iptables  (0) 2016.07.04
Selinux  (0) 2016.07.04

+ Recent posts