웹마짱구's 블로그

rsyncd

Linux/Linux : 2009/05/19 09:47


# cat /etc/rsyncd.conf
[ROOT]
path=/
comment=ANT
uid=root
gid=root
use chroot=yes
read only=yes
max connections=5
hosts allow = 113.30.102.xxx 222.96.155.xxx


# cat /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 = no
        socket_type     = stream
        wait            = no
        user            = root
        server          = /usr/bin/rsync
        server_args     = --daemon
        log_on_failure  += USERID
}


rsync -av --delete 222.96.155.xxx::ROOT/home/web/ /home/web/

rsync -av --exclude=pds/ --exclude=phpMyAdmin/ 222.xxx.xxx.xxx::ROOT/home/web/jjangu/ /home/www_user/jjangu/
==========================================================================




1.
설치


 

 - RPM : rpm -Uvh rsync-2.4.6-1.i386.rpm







2. 설정

 

- disable 확인 & xinetd.d restart & 포트 확인

 


# vi /etc/xinetd.d/rsync

 

  service rsync
  {
        disable = no


        socket_type = stream


        wait = no


        user = root


        server = /usr/bin/rsync


        server_args = --daemon


        log_on_failure += USERID

  }

 








  # /etc/rc.d/init.d/xinetd restart

 

  Stopping xinetd:                                           [  OK  ]


  Starting xinetd:                                             [  OK  ]

 

  # nmap localhost

 

  873/tcp  open  rsync

 




- rsyncd.conf 설정 & 실행

 


  # vi /etc/rsyncd.conf


  [dir_name]                          //
서비스명


  path = /home/dir                  // 미러링 경로


  uid = nobody


  gid = nobody


  use chroot = yes                  //
위의 path root 디렉토리로 사용(보안), 권고사항


  read only = yes


  hosts allow = xxx.xxx.xxx.xxx, yyy.yyy.yy.yy          //
허용IP(보안), 권고사항


  max connections = 3


  timeout 600

 

 

 


# /usr/bin/rsync --daemon

 







  - 클라이언트에서 rsync 사용하기

 


# rsync -arvz zzz.z.zz.zzz(서버IP)::dir_name(서비스명)/backup_data.log(디렉토리 혹은



파일) /home/get_data/(저장할 위치)

 

  

   -a : archive mode 심볼릭 링크, 속성, 퍼미션, 소유권등 보존

 

 

   -v : verbose 상세

 


   -r : recursive 순환



   -z : compress 전송시 압축

 


   -u : update only 새로운 파일을 덮어쓰지 않음



 

 

 

 


 

- rsync daemon start & check (873 port)

 

 

-데몬시작

 

/etc/rc.d/init.d/xinetd restart

 

 


-데몬확인

 

명령어 : telnet localhost 873

 

결과   : Trying 127.0.0.1...

 

Connected to localhost.localdomain (127.0.0.1).

 

Escape character is '^]'.

 

@RSYNCD: 29

 

 

명령어 : netstat -na | grep LISTEN

 

결과   : tcp        0      0 0.0.0.0:873                 0.0.0.0:*                   LISTEN

[출처] rsync 사용법|작성자 시라소니

top

TAG
Linux/Linux : 2009/05/19 09:47 Trackback. : Comment. : view 905

Trackback Address :: http://jjangu.pe.kr/blog/trackback/559

Write a comment.




: 1 : ... 50 : 51 : 52 : 53 : 54 : 55 : 56 : 57 : 58 : ... 548 :