[[email protected] ~]# yum install -y xinetd
[[email protected] ~]# yum install rsync
[[email protected] ~]# vi /etc/xinetd.d/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
flags = IPv6
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}
[[email protected] ~]# vi /etc/rsyncd.conf uid = root gid = root use chroot = no max connections = 10 transfer logging = true log format = "%o %h [%a] %m (%u) %f %l" log file = /var/log/rsyncd.log pid file = /var/run/rsyncd.pid lock file = /var/run/rsync.lock secrets file = /etc/rsyncd.pwd [web] path = /usr/local/tomcat7 auth users = tomcat ignore errors = true read only = no
[[email protected] ~]# vi /etc/rsyncd.pwd tomcat:abcd.1234 [[email protected] ~]# chmod 600 /etc/rsyncd.pwd
[[email protected] ~]# service xinetd start Starting xinetd: [ OK ]
[[email protected] ~]# yum -y install lua lua-devel [[email protected] ~]# yum install rsync [[email protected] ~]# yum install -y lsyncd [[email protected] ~]# vi /etc/lsyncd.conf settings { logfile ="/var/log/lsyncd/lsyncd.log", statusFile ="/var/log/lsyncd/lsyncd.status", inotifyMode = "CloseWrite", maxProcesses = 8, -- nodaemon =true, } sync { default.rsync, source = "/usr/local/tomcat7", target = "[email protected]::web", -- excludeFrom = "/etc/rsyncd.d/rsync_exclude.lst", rsync = { binary = "/usr/bin/rsync", archive = true, compress = true, verbose = true, password_file = "/etc/rsyncd.pwd" } }
[[email protected] ~]# vi /etc/rsyncd.pwd abcd.1234 [[email protected] ~]# chmod 600 /etc/rsyncd.pwd
[[email protected] ~]# /etc/init.d/lsyncd start Starting lsyncd: [ OK ] [[email protected] ~]# /etc/init.d/lsyncd status lsyncd (pid 3282) is running...
原文地址:http://blog.51cto.com/13598811/2089015
时间: 2024-11-05 21:51:33