반응형
    
    
    
  CentOS 4에 rsync 서버를 설치하고 설정하는 방법
rsync 패키지 설치
- rsync 패키지를 설치해야 합니다.
sudo yum install rsyncrsync 설정
rsync 패키지 확인
$ rpm -qa | grep rsync
rsync-2.6.3-1xinetd 패키지 확인
$ rpm -qa | grep xinetd
xinetd-2.3.13-4.5.el4xinetd(rsync) 설정 파일 수정
- rsync를 사용하기 위한 설정(disable = yes -> disable = no 변경)
vim /etc/xinetd.d/rsync# default: off
# description: The rsync server is a good addition to an ftp server, as it \
# allows crc checksumming etc.
service rsync
{
    disable = yes
    socket_type = stream
    wait = no
    user = root
    server = /usr/bin/rsync
    server_args = --daemon
    log_on_failure += USERID
}rsync 설정 파일 작성
- rsync를 사용하여 파일을 동기화하기 위해 설정 파일을 작성해야 합니다. 일반적으로 /etc/rsyncd.conf 파일을 사용합니다.
vim /etc/rsyncd.conf[home]
path = /home/scbyun
comment = homedirectory backup
uid = root #기본 nobody
gid = root #기본 nobody
use chroot = yes
# 보안상 지정한 경로를 최상위(root 디렉토리로 사용)로 설정
read only = yes # 읽기전용
# 읽기 전용 설정. PUT을 지원(클라이언트에서 서버로 업데이트)하기 위해서는 yes로 설정
hosts allow = 192.168.0.12 # 접근 가능한 호스트
max connections = 1 # 동시 접속자 수
timeout 600 # 클라이언트에서 접근 시 타임아웃시간설정 후 xinetd 데몬 재시작
service xinetd restart또는
/etc/init.d/xinetd restart방화벽 설정
- rsync를 사용하기 위해 방화벽에 포트를 열어야 합니다. 기본 포트는 TCP 873입니다.
rsync 클라이언트 설정
- rsync –avz 도메인(IP)::서비스명 /백업디렉토리/
rsync -avz 192.168.0.11::home /home/scbyun_backup/$ rsync -avz 192.168.0.11::home /home/scbyun_backup/
receiving file list ... done
created directory /home/scbyun_backup
./
ns3/
ns4/
.bash_history
.bash_logout
.bash_profile
.bashrc
.viminfo
domain.txt.gz
ns3/aa.sh
ns3/adfadf
ns3/domainfilter.sh
ns3/includefile_ns3-1.txt
ns3/includefile_ns3-2.txt
ns3/includefile_ns3.txt
zonetransfer.txt
sent 506 bytes received 339149 bytes 226436.67 bytes/sec
total size is 2885097 speedup is 8.49
rsync 서버가 CentOS 4에서 설치되었고 설정되었습니다. 원격 시스템에서 rsync 클라이언트를 사용하여 파일을 동기화할 수 있습니다.
728x90
    
    
  반응형
    
    
    
  '리눅스' 카테고리의 다른 글
| CentOS 6에 VNC를 설치하고 설정하는 방법 (0) | 2013.06.18 | 
|---|---|
| history 명령어 실행 시간 보기(history HISTTIMEFORMAT) (0) | 2013.06.18 | 
| 리눅스 환경에서 rsync 명령어로 데이터 동기화하는 방법 (1) | 2013.06.18 | 
| scp 명령어 (2) | 2013.06.18 | 
| Webalizer를 컴파일하고 설치하는 방법 (0) | 2013.06.17 | 
 
                  
                 
                  
                 
                  
                