요구환경
kernel 2.6.13 이상 버전
rsync package
libxml2 package
libxml2-devel package
rsync package
libxml2 package
libxml2-devel package
lsync 사용법
lsyncd [OPTION]... [SOURCE] [TARGET 1] [TARGET 2] ...
[SOURCE] => 동기화시 원본이 존제하는 위치 /home/test/
[TARGET X] => 동기화가 필요한 서버 192.168.0.3::HOME/test
[OPTION]
--binary FILE rsync 실행 파일 위치
--conf FILE 실행시 로드할 설정 파일명 (DEFAULT: /etc/lsyncd.conf.xml)
--debug 디버그를 위한 로그
--exclude-from FILE 동기화시 제외시킬 패턴의 옵섭
--logfile FILE 로그 파일위치
--no-daemon 포그라운드로 실행 시킴
--pidfile FILE pid 파일 생성위치
설정방법
슬레이브 서버
rsyncd를 서비스에 추가시켜 rsync접속이 가능하도록 한다
/etc/rsyncd.conf -->
[HOME]
path = /home/test
uid = root
gid = root
use chroot = yes
read only = no # 마스터에서 배포시 쓰기가 가능해야 한다
max connections = 4
hosts allow = 192.168.0.1 # 마스터 서버에서만 접속이 가능하도록 설정
위와 같이 마스터서버에서만 rsync 데몬만 이용할수있도록 하며 마스터에서 파일을 슬레이브로 쓰는 형태이므로 쓰기원한을 주어야한다
세팅후 rsync 데몬을 시작한다 .
마스터 서버
데몬 직접 띄우기
# lsyncd /home/test/ 192.168.0.3::HOME/test
설정파일을 이용하여 실행시키기
/etc/lsyncd.conf.xml 파일을 생성하여
<lsyncd version="1">
<settings>
<logfile filename="/var/log/lsyncd"/>
<binary filename="/usr/bin/rsync"/>
<callopts>
<option text="-az%r"/>
<option text="--delete"/>
</callopts>
</settings>
<directory>
<source path="/home/test/"/>
<target path="192.168.0.2::HOME/"/>
</directory>
</lsyncd>
설정 파일을 작성하고
/etc/rc.d/init.d/lsyncd 파일을 생성하여
#!/bin/bash
# description: lsyncd auto start script
start() {
pid=`pidof lsyncd`
if [ $? -eq 0 ]; then
echo "lsyncd (pid $pid) is running..."
echo " "
else
echo "Starting lsyncd..."
echo " "
/usr/bin/lsyncd
fi
}
stop() {
echo "Stopping lsyncd..."
echo " "
/bin/kill -9 `/sbin/pidof lsyncd`
until [ -z $(/sbin/pidof lsyncd) ]; do :; done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
pid=`pidof lsyncd`
if [ $? -eq 0 ]; then
echo "lsyncd (pid $pid) is running..."
echo " "
else
echo "lsyncd is not running"
echo " "
fi
;;
*)
echo "Usage: lsyncd {start|stop|restart|status}"
exit 1
esac
exit $?
/etc/rc.d/init.d/lsyncd start를 하게 되면 실행된다
lsyncd [OPTION]... [SOURCE] [TARGET 1] [TARGET 2] ...
[SOURCE] => 동기화시 원본이 존제하는 위치 /home/test/
[TARGET X] => 동기화가 필요한 서버 192.168.0.3::HOME/test
[OPTION]
--binary FILE rsync 실행 파일 위치
--conf FILE 실행시 로드할 설정 파일명 (DEFAULT: /etc/lsyncd.conf.xml)
--debug 디버그를 위한 로그
--exclude-from FILE 동기화시 제외시킬 패턴의 옵섭
--logfile FILE 로그 파일위치
--no-daemon 포그라운드로 실행 시킴
--pidfile FILE pid 파일 생성위치
설정방법
슬레이브 서버
rsyncd를 서비스에 추가시켜 rsync접속이 가능하도록 한다
/etc/rsyncd.conf -->
[HOME]
path = /home/test
uid = root
gid = root
use chroot = yes
read only = no # 마스터에서 배포시 쓰기가 가능해야 한다
max connections = 4
hosts allow = 192.168.0.1 # 마스터 서버에서만 접속이 가능하도록 설정
위와 같이 마스터서버에서만 rsync 데몬만 이용할수있도록 하며 마스터에서 파일을 슬레이브로 쓰는 형태이므로 쓰기원한을 주어야한다
세팅후 rsync 데몬을 시작한다 .
마스터 서버
데몬 직접 띄우기
# lsyncd /home/test/ 192.168.0.3::HOME/test
설정파일을 이용하여 실행시키기
/etc/lsyncd.conf.xml 파일을 생성하여
<lsyncd version="1">
<settings>
<logfile filename="/var/log/lsyncd"/>
<binary filename="/usr/bin/rsync"/>
<callopts>
<option text="-az%r"/>
<option text="--delete"/>
</callopts>
</settings>
<directory>
<source path="/home/test/"/>
<target path="192.168.0.2::HOME/"/>
</directory>
</lsyncd>
설정 파일을 작성하고
/etc/rc.d/init.d/lsyncd 파일을 생성하여
#!/bin/bash
# description: lsyncd auto start script
start() {
pid=`pidof lsyncd`
if [ $? -eq 0 ]; then
echo "lsyncd (pid $pid) is running..."
echo " "
else
echo "Starting lsyncd..."
echo " "
/usr/bin/lsyncd
fi
}
stop() {
echo "Stopping lsyncd..."
echo " "
/bin/kill -9 `/sbin/pidof lsyncd`
until [ -z $(/sbin/pidof lsyncd) ]; do :; done
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
pid=`pidof lsyncd`
if [ $? -eq 0 ]; then
echo "lsyncd (pid $pid) is running..."
echo " "
else
echo "lsyncd is not running"
echo " "
fi
;;
*)
echo "Usage: lsyncd {start|stop|restart|status}"
exit 1
esac
exit $?
/etc/rc.d/init.d/lsyncd start를 하게 되면 실행된다
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 3730 | 14년 전 | 938 | ||
| 3729 | 14년 전 | 758 | ||
| 3728 | 14년 전 | 752 | ||
| 3727 | 14년 전 | 740 | ||
| 3726 | 14년 전 | 1149 | ||
| 3725 | 14년 전 | 847 | ||
| 3724 | 14년 전 | 857 | ||
| 3723 |
올인할거야
|
14년 전 | 873 | |
| 3722 |
berry
|
14년 전 | 678 | |
| 3721 |
Darby
|
14년 전 | 1739 | |
| 3720 | 14년 전 | 1504 | ||
| 3719 | 14년 전 | 931 | ||
| 3718 |
gangjin
|
14년 전 | 756 | |
| 3717 |
플레이디원
|
14년 전 | 1831 | |
| 3716 | 14년 전 | 1199 | ||
| 3715 |
berry
|
14년 전 | 1039 | |
| 3714 | 14년 전 | 798 | ||
| 3713 |
|
14년 전 | 1500 | |
| 3712 | 14년 전 | 3760 | ||
| 3711 | 14년 전 | 2420 | ||
| 3710 |
SGFlash
|
14년 전 | 1112 | |
| 3709 |
프로프리랜서
|
14년 전 | 721 | |
| 3708 |
kavri
|
14년 전 | 778 | |
| 3707 | 14년 전 | 1300 | ||
| 3706 | 14년 전 | 968 | ||
| 3705 | 14년 전 | 1344 | ||
| 3704 | 14년 전 | 1387 | ||
| 3703 | 14년 전 | 1408 | ||
| 3702 |
방황하는중년
|
14년 전 | 616 | |
| 3701 | 14년 전 | 858 | ||
| 3700 | 14년 전 | 2734 | ||
| 3699 | 14년 전 | 753 | ||
| 3698 | 14년 전 | 1222 | ||
| 3697 | 14년 전 | 805 | ||
| 3696 |
|
14년 전 | 686 | |
| 3695 | 14년 전 | 1220 | ||
| 3694 | 14년 전 | 650 | ||
| 3693 |
|
14년 전 | 1333 | |
| 3692 |
아갈갤러리
|
14년 전 | 921 | |
| 3691 | 14년 전 | 1578 | ||
| 3690 | 14년 전 | 1514 | ||
| 3689 | 14년 전 | 1019 | ||
| 3688 | 14년 전 | 1248 | ||
| 3687 | 14년 전 | 931 | ||
| 3686 | 14년 전 | 1642 | ||
| 3685 | 14년 전 | 1218 | ||
| 3684 |
방황하는중년
|
14년 전 | 1214 | |
| 3683 |
휴전합시다
|
14년 전 | 1503 | |
| 3682 | 14년 전 | 1404 | ||
| 3681 | 14년 전 | 827 | ||
| 3680 | 14년 전 | 891 | ||
| 3679 | 14년 전 | 659 | ||
| 3678 | 14년 전 | 834 | ||
| 3677 |
|
14년 전 | 1582 | |
| 3676 |
|
14년 전 | 2337 | |
| 3675 | 14년 전 | 2231 | ||
| 3674 | 14년 전 | 1870 | ||
| 3673 |
|
14년 전 | 1411 | |
| 3672 | 14년 전 | 1487 | ||
| 3671 | 14년 전 | 1268 | ||
| 3670 |
아놔6636
|
14년 전 | 1524 | |
| 3669 | 14년 전 | 637 | ||
| 3668 |
아놔6636
|
14년 전 | 1271 | |
| 3667 | 14년 전 | 637 | ||
| 3666 | 14년 전 | 1076 | ||
| 3665 | 14년 전 | 848 | ||
| 3664 | 14년 전 | 1961 | ||
| 3663 | 14년 전 | 730 | ||
| 3662 | 14년 전 | 2552 | ||
| 3661 | 14년 전 | 966 | ||
| 3660 | 14년 전 | 806 | ||
| 3659 | 14년 전 | 2911 | ||
| 3658 | 14년 전 | 677 | ||
| 3657 | 14년 전 | 944 | ||
| 3656 | 14년 전 | 487 | ||
| 3655 | 14년 전 | 815 | ||
| 3654 |
쉽다zzz
|
14년 전 | 591 | |
| 3653 | 14년 전 | 1284 | ||
| 3652 | 14년 전 | 719 | ||
| 3651 | 14년 전 | 1086 | ||
| 3650 | 14년 전 | 712 | ||
| 3649 | 14년 전 | 644 | ||
| 3648 | 14년 전 | 623 | ||
| 3647 | 14년 전 | 1329 | ||
| 3646 |
|
14년 전 | 788 | |
| 3645 | 14년 전 | 676 | ||
| 3644 | 14년 전 | 697 | ||
| 3643 | 14년 전 | 1369 | ||
| 3642 |
|
14년 전 | 1377 | |
| 3641 |
|
14년 전 | 577 | |
| 3640 | 14년 전 | 2461 | ||
| 3639 | 14년 전 | 451 | ||
| 3638 |
방황하는중년
|
14년 전 | 727 | |
| 3637 | 14년 전 | 3188 | ||
| 3636 | 14년 전 | 651 | ||
| 3635 | 14년 전 | 1083 | ||
| 3634 | 14년 전 | 1440 | ||
| 3633 |
|
14년 전 | 566 | |
| 3632 | 14년 전 | 756 | ||
| 3631 | 14년 전 | 810 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기