반응형
lsync 설치
lsync 서버
======
yum -y install lua-devel asciidoc --skip-broken
./configure
make
make install
make
make install
vi /etc/lsyncd.conf
=============
settings {
statusFile = "/tmp/lsyncd.stat",
logfile = "/var/log/lsyncd.log",
statusInterval = 1,
}
sync {
default.rsync,
source="/home/",
target="211.189.0.249::file",
exclude="/log",
}
statusFile = "/tmp/lsyncd.stat",
logfile = "/var/log/lsyncd.log",
statusInterval = 1,
}
sync {
default.rsync,
source="/home/",
target="211.189.0.249::file",
exclude="/log",
}
==============
vi /etc/init.d/lsyncd
=============
#!/bin/bash
#
# chkconfig: - 85 15
# description: Lightweight inotify based sync daemon
#
# processname: lsyncd
# config: /etc/lsyncd.conf
# config: /etc/sysconfig/lsyncd
# pidfile: /var/run/lsyncd.pid
# Source function library
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
OPTIONS="-pidfile /var/run/lsyncd.pid /etc/lsyncd.conf"
#if [ -e /etc/sysconfig/lsyncd ]; then
# /etc/sysconfig/lsyncd
#fi
RETVAL=0
prog="lsyncd"
thelock=/var/lock/subsys/lsyncd
start() {
[ -f /etc/lsyncd.conf ] || exit 6
echo -n $"Starting $prog: "
if [ $UID -ne 0 ]; then
RETVAL=1
failure
else
daemon /usr/local/bin/lsyncd $OPTIONS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $thelock
fi;
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
if [ $UID -ne 0 ]; then
RETVAL=1
#
# chkconfig: - 85 15
# description: Lightweight inotify based sync daemon
#
# processname: lsyncd
# config: /etc/lsyncd.conf
# config: /etc/sysconfig/lsyncd
# pidfile: /var/run/lsyncd.pid
# Source function library
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
OPTIONS="-pidfile /var/run/lsyncd.pid /etc/lsyncd.conf"
#if [ -e /etc/sysconfig/lsyncd ]; then
# /etc/sysconfig/lsyncd
#fi
RETVAL=0
prog="lsyncd"
thelock=/var/lock/subsys/lsyncd
start() {
[ -f /etc/lsyncd.conf ] || exit 6
echo -n $"Starting $prog: "
if [ $UID -ne 0 ]; then
RETVAL=1
failure
else
daemon /usr/local/bin/lsyncd $OPTIONS
RETVAL=$?
[ $RETVAL -eq 0 ] && touch $thelock
fi;
echo
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
if [ $UID -ne 0 ]; then
RETVAL=1
failure
else
killproc /usr/local/bin/lsyncd
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f $thelock
fi;
echo
return $RETVAL
}
reload(){
echo -n $"Reloading $prog: "
killproc /usr/local/bin/lsyncd -HUP
RETVAL=$?
echo
return $RETVAL
}
restart(){
stop
start
}
condrestart(){
[ -e $thelock ] && restart
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
condrestart)
condrestart
;;
else
killproc /usr/local/bin/lsyncd
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f $thelock
fi;
echo
return $RETVAL
}
reload(){
echo -n $"Reloading $prog: "
killproc /usr/local/bin/lsyncd -HUP
RETVAL=$?
echo
return $RETVAL
}
restart(){
stop
start
}
condrestart(){
[ -e $thelock ] && restart
return 0
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
condrestart)
condrestart
;;
status)
status lsyncd
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
RETVAL=1
esac
exit $RETVAL
status lsyncd
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
RETVAL=1
esac
exit $RETVAL
======================
chmod +x /etc/init.d/lsyncd
/etc/init.d/lsyncd start
/etc/init.d/lsyncd start
rsync -avz 211.189.0.249::file 130724_VPN이미지.zip
================================
클라이언트서버
===========
yum -y install xinetd
vi /etc/xinetd.d/rsync
==============
disable = no 수정
vi /etc/rsyncd.conf
=========
[file]
path = /home
hosts allow = *
hosts deny = *
read only = false
uid=0
gid=0
exclude = .svn
path = /home
hosts allow = *
hosts deny = *
read only = false
uid=0
gid=0
exclude = .svn
반응형
'리눅스 > centos' 카테고리의 다른 글
[centos]5.8 설치(5.x) (0) | 2014.03.17 |
---|---|
[centos]cpu,memory 확인하기 (0) | 2014.03.17 |
[centos]실행 권한없는 tmp 파티션 만들기 (0) | 2014.03.12 |
[centos]APM 설치 6 - 설시치 문제점 해결책 (0) | 2014.03.12 |
[centos]APM 설치 5 - php 5.3.28 설치 (2) | 2014.03.11 |