리눅스 UNISON 환경설정



특정 폴더를 제외하는 옵션 및 unison 사용방법에 대해서 알아보겠습니다.


▶ 환경설정 파일 없이 명령어로 실행하는 방법


unison -batch -times -ignore='Path test1' -ignore='Path test2' -ignore='Path test3' -logfile=/var/log/unison.log /var/www/html ssh://root@192.168.1.3//var/www/html



▶ unison 환경설정 하기 ( vi /root/.unison/default.prf )


# Unison preferences file

root = /var/www/html

root = ssh://root@192.168.1.3//var/www/html

sshargs = -p 10022

ignore = Path test1

ignore = Path test2

ignore = Path test3

ignore = Name *.tmp

ignore = Name *.swp

batch = true

times = true

logfile = /var/log/unison.log


root : 첫번째는 로컬의 디렉토리


root : 두번째는 원격지의 디렉토리 ( 포트가 22번이 아니라면 아이피 뒤에 :포트번호를 적어주면 됩니다. )

원격지 주소뒤에는 원격지의 폴더 구분자로 / 적어주어야 됩니다. 슬래쉬가 두개가 되는거지요~


sshargs : ssh 접속 포트를 입력합니다. root 에서 주소뒤에 포트번호를 적어주어도 됩니다.


ignore : 제외할 폴더를 나열하며 됩니다. /var/www/html/test1 이라면 test1 만 적어주면 됩니다.

path 가 아닌 파일명은 Name *.tmp 이렇게 적어주면 됩니다.

batch : 물어보지 않고 실행하는 옵션입니다.

times : 파일의 시간 정보도 싱크하는 옵션입니다.

logfile : 로그 파일이 저장되는 경로입니다.


블로그 이미지

영은파더♥

가상서버호스팅 VPS 리눅스 서버관리 윈도우 IT

,