2016. 4. 28. 16:13 리눅스(Linux)
centos rsync 설정.
-------------------------------------------------
1. rsync 클라이언트쪽 작업
-------------------------------------------------
1) rsync가 설치되어 있는지 확인한다.
rpm -qa | grep rsync
2) rsync 가 설치되어있다면 /etc/xinet.d/밑에 rsync 있는지 확인한다.
3) vi로 /etc/xinetd.d/rsync 를 열어서 disable = no 로 설정
service rsync
{
disable = no
flags = IPv6
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
4) /etc 아래에 rsyncd.conf 파일을 열어서 편집한다.(없으면 새로 생성한다.)
# rsyncd.conf 파일 내용 예
[html]
path = /usr/local/apache/html_src
comment = html
uid = root
gid = root
use chroot = yes
read only = no
hosts allow = 2xx.xxx.xxx.xxx
max clients = 2
timeout 60
[images]
path = /usr/local/apache/images
comment = images
uid = root
gid = root
use chroot = yes
read only = no
hosts allow = 2x.xxx.xx.xxx
max clients = 2
timeout 60
5) 편집후 xinetd를 다시 실행한다.
service xinetd restart
6) /var/log/message 에서 에러가 있는지 확인한다.
7) iptables 방화벽 설정 추가
-A INPUT -m state --state NEW -m tcp -p tcp --dport 873 -s 1xx.xx.xxx.xxx -j ACCEPT
-------------------------------------------------
2. rsync 서버쪽 작업
-------------------------------------------------
1) 스크립트 작성 - UpRsync.sh
rsync -arz --delete /data/project1/upload/ 1xx.xx.xx.xx::upload
rsync -arz --delete /data/project1/upload/ 1xx.xx.xx.xx::upload
'리눅스(Linux)' 카테고리의 다른 글
여러 프로세스 한번에 죽이기 kill (0) | 2016.12.05 |
---|---|
Unix/Linux 디스크 용량 확인 (df/du) (0) | 2016.06.29 |
iptables 세팅 (0) | 2016.04.04 |
리눅스/유닉스, sar 을 통한 시스템 관리. (0) | 2016.04.01 |
리눅스 파일 내 문자열 검색 (0) | 2016.03.17 |