(1)rsync配置文件vim /etc/rsyncd.confuid = rootgid = rootuse chroot = nomax connections = 20pid file = /var/run/rsyncd.pidlock file = /var/run/rsync.locklog file = /var/log/rsyncd.log[web]path = /var/...

(1)rsync配置文件
vim /etc/rsyncd.conf
uid = root
gid = root
use chroot = no
max connections = 20
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log file = /var/log/rsyncd.log
[web]
path = /var/www/html/bbs/
ignore errors
read only = yes
hosts allow = 192.168.1.0/24
hosts deny = 0.0.0.0/32
(2)启动rsync守护进程
/usr/bin/rsync -daemon
同步脚本
#!/bin/sh
while true
do
/usr/bin/rsync -av 192.168.1.3::web /bbs/>/dev/null 2>&1
sleep 20
done
rsync -vzrtopg 192.168.1.3::web /bbs/
/usr/bin/nohup /bin/sh /usr/local/webserver/tb.sh 2>&1 >/dev/null & #不受shell中Ctrl C和shell关闭的影响
同步.bat
@echo off
:1
d: 放d盘
echo同歩中
rsync -av 192.168.1.10::web \APMSer\www\htdocs\ppsping 127.0 -n 2 >nul 2>nul
goto 1
织梦狗教程
本文标题为:apache web页面的rsync同步


基础教程推荐
猜你喜欢
- Apache Kafka 2.5 稳定版发布,新特性抢先看 2023-09-11
- Docker容器操作方法详解 2022-11-13
- 通过StatefulSet部署有状态服务应用实现方式 2022-10-01
- Apache CarbonData 1.0.0发布及其新特性介绍 2023-09-11
- RFO SIG之openEuler AWS AMI 制作详解 2022-12-28
- Centos 安装Django2.1 2023-09-24
- windows环境下apache-apollo服务器搭建 2023-09-10
- 为Win2003服务器打造铜墙铁壁的方法步骤 2022-09-01
- P3 利用Vulnhub复现漏洞 - Apache SSI 远程命令执行漏洞 2023-09-10
- Centos7 nginx的安装以及开机自启动的设置 2023-09-22