** 서버쪽 설정
 - xinetd 에서 구동 설정
  . rsync 는 xinetd 에서 구동 됨
  . 초기 설정은 disable = yes 로 되어있음
-----------------------------------------------------------------------------------------
/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
}
-----------------------------------------------------------------------------------------

 - rsync 환경 설정
  . rsync가 설치되어 있어도 rsyncd.conf 화일이 /etc 밑에 없을 수 있음
-----------------------------------------------------------------------------------------
/etc/rsyncd.conf
-----------------------------------------------------------------------------------------
[img]
path = /disk1/img
comment = image
uid = root
gid = root
use chroot = yes
read only = yes
hosts allow = 192.168.0.10 192.168.0.11 192.168.0.12
max connections = 2
timeout = 600


[goods]
path = /disk2/goods
comment = goods image
uid = root
gid = root
use chroot = yes
read only = yes
hosts allow = 192.168.0.10 192.168.0.11 192.168.0.12
max connections = 2
timeout = 600
-----------------------------------------------------------------------------------------




** 클라이언트에서의 접근

-----------------------------------------------------------------------------------------
ex1) /usr/bin/rsync -avzrtl --delete --exclude=*/pattern/* 192.168.0.27::img/www-image       /disk1/img

ex2) /usr/bin/rsync -avzrt --delete 192.168.0.27::intra/workdesk/data       /workdesk/data


--- 메모 ---
 -a, --archive               archive mode; same as -rlptgoD (no -H)
 -v, --verbose               increase verbosity
 -z, --compress              compress file data during the transfer
 -r, --recursive             recurse into directories
 -t, --times                 preserve times
 -l, --links                 copy symlinks as symlinks
                             링크 대신 해당 디렉토리 안의 파일을 카피할때는 이 옵션을 뺀다

 

--exclude=*/pattern/*    :    특정 디렉토리를 제외하기 위해








-----------------------------------------------------------------------------------------
Posted by 곰!
,