반응형

rsync.conf 정보

uid = root
gid = dba
max connections = 50
use chroot = yes
#read only = no
#write only = yes

hosts allow = 192.168.10.0/24 192.18.25.0/24

[receive]
        path = /dblab/rsync/receive_directory/
        incoming chmod = Dug=rwx,Do=rw,Fug=rw,Fo=r
        read only = no
        #write only = yes

[tmp]
        path = /dblab/rsync/tmp/
        incoming chmod = Dug=rwx,Do=rx,Fug=rw,Fo=r

 

rsync 포트 : 873

 

1. 포트 확인 방법

nc -z 192.168.10.10 873 

(현재 자신의 서버에서 192.168.10.10 서버로 873 포트가 open되어 있는지 확인)

 

2.  자신의 파일을 다른 서버로 보내고자 할 때

(해당 서버의 a.txt 파일을 rsync가 설치되어 있는 곳으로 보낸다. rsync 폴더 정보는 /etc/rsyncd.conf 로 확인할 수 있다.)

 

rsync -avh --progress --bwlimit=40960 /home/theswice/a.txt   192.168.10.10::receive/

 

(--bwlimit : 속도제한이여서 40960이면 다운로드나 업로드 속도가 40Mbps이상은 올라가지 않게 하겠다는 의미이다.)

 

3. 다른 서버에서 자신의 서버로 파일을 받고자 할 때

rsync -avh --progress --bwlimit=40960 192.168.10.10::receive/a.txt /home/theswice/

 

4. 경로를  업로드 하고 싶을 경우

rsync -avh --progress --bwlimit=40960 /home/theswice/   192.168.10.10::receive/

(경로의 하위디렉토리까지 업로드하고자 할 경우에는 -avhr로 r을 옵션으로 붙여주면 된다.)

 

5. 경로를 다운로드 하고 싶을 경우

rsync -avh --progress --bwlimit=40960 192.168.10.10::receive/ /home/theswice/

 

※ 2번과 3번의 공통점은 rsync가 설치되어 있는 서버에서 명령어를 실행하는 것이 아니라

    rsync가 설치되어 있지 않은 곳에서 rsync가 설치되어 있는 서버로 명령어를 실행해줘야 한다. 

[출처] RSYNC 사용법|작성자 theswice


반응형

'연구개발 > Linux' 카테고리의 다른 글

IOPS CHECK  (0) 2014.12.04
리눅스의 실제 메모리 사용량 보기  (0) 2014.11.27
Disk IO 사용률  (0) 2014.11.25
/bin/bash^M: bad interpreter: no such file or directory  (0) 2014.10.08
TERMINATOR 설치  (0) 2014.08.06

+ Recent posts