(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同步


猜你喜欢
- 解决:apache24 安装后闪退和配置端口映射和连接超时设置 2023-09-11
- 阿里云ECS排查CPU数据分析 2022-10-06
- 【转载】CentOS安装Tomcat 2023-09-24
- 教你在docker 中搭建 PHP8 + Apache 环境的过程 2022-10-06
- nginx中封禁ip和允许内网ip访问的实现示例 2022-09-23
- CentOS7安装GlusterFS集群的全过程 2022-10-10
- IIS搭建ftp服务器的详细教程 2022-11-15
- KVM虚拟化Linux Bridge环境部署的方法步骤 2023-07-11
- 利用Docker 运行 python 简单程序 2022-10-16
- CentOS_mini下安装docker 之 安装docker CE 2023-09-23