参考文档:
http://blog.s135.com/visit.php?job=viewresult&sid=c0e8a881c7627efeab9542198c0ff72c
------------------------------------------------------------------------
----rsync安装
------------------------------------------------------------------------
--创建连接账户
/usr/sbin/groupadd www -g 48
/usr/sbin/useradd -u 48 -g www www
mkdir -p /data/htdocs/myfarm
chmod +w /data/htdocs/myfarm
chown -R www:www /data/htdocs/myfarm
------------------------------------------------------------------------
tar zxvf rsync-2.4.6.tar.gz
cd rsync-2.4.6/
./configure
make
make install
cd ../
------配置rsync_server端
uid = www
gid = www
use chroot = no
max commections = 4
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[backup_www]
path = /data/htdocs/myfarm/
ignore errors
read only = false
list = false
hosts allow = 10.65.133.145
------------------------启动 rsync------------------------------------
/usr/bin/rsync --daemon
------------------------配置 rsync.conf-------------------------------
vi /etc/rsyncd.conf
配置完之后需要kill掉原来的进程,重新启动新进程
----------------------------------------------------------------------
*****************************************************************************************
运行客户端往服务器端推送
参数:ip为局域网IP
/usr/bin/rsync -vzrtopg --delete /data/htdocs/myfarm/ 10.65.133.143::backup_www/
/usr/bin/rsync -vzrtopg --delete /data/htdocs/myfarm/ 10.65.133.151::backup_www/
*****************************************************************************************
------------------------------------------------------------------------
----rsync安装
------------------------------------------------------------------------
--创建连接账户
/usr/sbin/groupadd www -g 48
/usr/sbin/useradd -u 48 -g www www
mkdir -p /data/htdocs/myfarm
chmod +w /data/htdocs/myfarm
chown -R www:www /data/htdocs/myfarm
------------------------------------------------------------------------
tar zxvf rsync-2.4.6.tar.gz
cd rsync-2.4.6/
./configure
make
make install
cd ../
------配置rsync_server端
uid = www
gid = www
use chroot = no
max commections = 4
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[backup_www]
path = /data/htdocs/myfarm/
ignore errors
read only = false
list = false
hosts allow = 10.65.133.145
------------------------启动 rsync------------------------------------
/usr/bin/rsync --daemon
------------------------配置 rsync.conf-------------------------------
vi /etc/rsyncd.conf
配置完之后需要kill掉原来的进程,重新启动新进程
----------------------------------------------------------------------
*****************************************************************************************
运行客户端往服务器端推送
参数:ip为局域网IP
/usr/bin/rsync -vzrtopg --delete /data/htdocs/myfarm/ 10.65.133.143::backup_www/
/usr/bin/rsync -vzrtopg --delete /data/htdocs/myfarm/ 10.65.133.151::backup_www/
*****************************************************************************************
当然也可以写一个简单的shell脚本。