블로그 이미지
예진이와 고고씽!! 괴스트

카테고리

분류 전체보기 (385)
Yejin (247)
Life (44)
Dev (62)
Etc (28)
Total63,965
Today136
Yesterday177

달력

« » 2010.08
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

태그목록

Tistory Cumulus Flash tag cloud by BLUEnLIVE requires Flash Player 9 or better.

rsync 사용하기

Dev/linux / 2010/01/26 10:48
크리에이티브 커먼즈 라이선스
Creative Commons License
1. apt-get install rsync 명령을 통해 rsync를 설치해준다.

2. apt-get install xinetd 명령을 통해 xinetd를 설치해준다.

3. /etc/xinetd/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
}

4. /etc/init.d/xinetd restart를 통해 재시작해준다.

5. /etc/rsyncd.conf 파일을 다음과 같이 추가한다.

[Destination]
path
= /home/destination
comment
= server
uid
= nobody
gid
= nobody
use chroot = yes
read only
= yes
host allow
= 192.168.0.3
max connection
= 1
timeout
300

각자의 내용에 맞게 수정한다.

path : 공유할 디렉토리
comment : 설명
uid : 접근할 user id
gid : 접근할 group id
use chroot : chroot를 사용할지 여부, 특별한 이유가 없는 이상 꼭 사용할 것
read only : 읽기만 가능할 것인지, 백업의 피 대상이므로 yes로 설정
host allow : 접근 가능한 호스트 설정. 백업서버만 접근 가능하도록 설정
max connection : 최대 몇개의 커넥션을 연결할 수 있는지 설정
timeout : 타임아웃 시간 설정


6. 다음 명령을 통해 끌어온다.

rsync -avz 서버IP::Destination 백업받을위치

퍼미션 에러가 난다면 적절히 uid와 gid를 수정해서 백업대상 폴더의 권한을 획득할 수 있도록 해준다.
저작자 표시
Posted by 예진이네집 괴스트
크리에이티브 커먼즈 라이선스
Creative Commons License
*윈도우- rsync 데몬모드 설정 (rsync 2.5 버젼기준 입니다.)

필요한파일
c:\rsync\rsync.exe
c:\rsync\cygwin1.dll
c:\rsync\rsyncd.conf (메모장으로 별도 생성하고 rsyncd.conf로저장하면됨.)


d:\gabia라는 폴더명을 예로 한것을 참고하여 아래와 같이 rsyncd.conf 파일을 생성하면 됩니다.

[SERVER6] -> 명칭
path = /cygdrive/d/gabia -> d:\gabia(경로를 설정할때 d:\ 앞에 /cygdrive/ 가 있어야 합니다.)
use chroot = false

데몬모드로실행
c:\rsync\rsync --daemon --config= c:\rsync\rsyncd.conf 또는 rsync.exe --daemon --config rsyncd.conf

리눅스 서버에서 rsync 데몬모드로 설정한 윈도우서버의 데이타를 가져옵니다.
rsync -av 서버IP::SERVER6(rsyncd.conf에서 지정한명칭)/data(가져올내용) ./(현재디렉토리)

저작자 표시
Posted by 예진이네집 괴스트