커피닉스, 시스템 엔지니어의 쉼터
  rsync의 write only 기능(쓰기만 가능한 설정) 작성일 : 2004/12/03 13:30
 
  • 글쓴이 : 좋은진호 ( http://coffeenix.net/ )
  • 조회수 : 14129
     
    제  목 : rsync의 write only 기능(쓰기만 가능한 설정)
    작성자 : 좋은진호(truefeel, http://coffeenix.net/ )
    작성일 : 2004.12.3(금)

    데이터 파일을 sync하기 위한 rsync를 주로 사용하는데, 다음과 같은 경우를 생각해보자.

    - 서버의 중요 설정 파일을 백업할 서버(백업 서버 1)가 별도로 있고, rsync daemon이 돌고 있다.
    - 각 서버의 중요 파일은 백업 서버 1로 sync된다. 따라서 모든 서버의 설정 파일이 백업 서버 1에 있게된다.
    - 그러나 백업 서버 1을 통해서 A라는 서버에서 B서버의 환경 파일을 sync로 받아갈 수 있다.

    이런 경우 좀 더 나은 보안 설정을 위해 백업 서버 1으로 백업된 다른 파일을 받아갈 수 없도록 해야 한다.
    rsync 2.6.3부터 추가된 write only 옵션으로 가능하다.

    다음은 rsyncd.conf 파일이다.

     
    [backup_dir]
    uid             = root
    gid             = wheel
    path            = /data/BACKUP
    comment         = data backup
    read only       = no
    write only      = yes

     


    * 192.168.2.123 로 config.tar.gz를 백업할 때

     
    # rsync -av config.tar.gz 192.168.2.123::backup_dir
    building file list ... done
    config.tar.gz
    wrote 131 bytes  read 56 bytes  374.00 bytes/sec
    total size is 3  speedup is 0.02
     



    * 192.168.2.123 에 백업된 다른 서버의 설정파일 B_config.tar.gz를 받아올 때

     
    # rsync -av  192.168.2.123::backup_dir B_config.tar.gz
    receiving file list ... ERROR: module is write only
    rsync error: syntax or usage error (code 1) at main.c(414)
    rsync: connection unexpectedly closed (28 bytes read so far)
    rsync error: error in rsync protocol data stream (code 12) at io.c(165)
     


    * 관련글

    - Rsync를 이용한 데이터 미러링 구축 (글 굿스피드)
      http://coffeenix.net/board_view.php?cata_code=61&bd_code=166

    - 자료를 다른 파티션으로 그대로 백업(rsync이용, 글 좋은진호)
      http://coffeenix.net/board_view.php?cata_code=0&bd_code=88


    커피닉스, 시스템 엔지니어의 쉼터 / URL : http://coffeenix.net/board_view.php?bd_code=616