Rsync学习笔记2

Rsync:

增量操作:

1) server01服务文件变动。

bash 复制代码
[root@server03 tp5shop]# rsync -av /usr/local/nginx/html/tp5shop [email protected]:/usr/local/nginx/html/
sending incremental file list

sent 88,134 bytes  received 496 bytes  177,260.00 bytes/sec
total size is 59,993,071  speedup is 676.89


[root@server03 tp5shop]# touch 123


[root@server03 tp5shop]# rsync -av /usr/local/nginx/html/tp5shop [email protected]:/usr/local/nginx/html/
sending incremental file list

sent 88,162 bytes  received 500 bytes  59,108.00 bytes/sec
total size is 59,993,071  speedup is 676.65
[root@server03 tp5shop]#

我这个操作的过程中,遇到一个问题:sending incremental file list下面没有任何显示。

2)然后在server03服务器上进行查看:

-a 选项 跟-rlptgoD选项类似。保证文件的属性。

-v 是将显示rsync的同步过程。

--delete:

从目的地目录删除无关文件。

以上操作,可以增量同步,删除已无关的文件。

有个问题:不能够文件变动就同步,想折中的版本通过计划任务(crontab),crontab默认一分钟。不能实时进行同步。

相关推荐
goodlook01235 分钟前
docker 安装运行mysql8.4.4
运维·docker·容器
运维行者_7 分钟前
Azure数据库监控:如何在2025年选择合适的工具
运维·服务器·网络·数据库·flask·自动化·azure
dbkx_298 分钟前
个人自用debian启动
linux·运维·debian
dualven_in_csdn2 小时前
搞了两天的win7批处理脚本问题
java·linux·前端
晨曦backend3 小时前
Vim 匹配跳转与搜索命令完整学习笔记
linux·编辑器·vim
爬呀爬的水滴4 小时前
解决Ubuntu24.04版本,右键没有共享选项的问题
linux·服务器·ubuntu·samba·共享文件夹
IT coke5 小时前
centos7部署AWStats日志分析系统
linux·运维·centos
雾岛心情5 小时前
【黑客与安全】Linux的常用命令之系统架构信息获取系列命令
linux·运维·服务器
杯莫停丶6 小时前
Linux基础指令大全
linux·运维·chrome
Gold Steps.7 小时前
JumpServer:解锁运维安全的数字 “钥匙”
运维·安全·jumpserver