Rsync学习笔记2

Rsync:

增量操作:

1) server01服务文件变动。

bash 复制代码
[root@server03 tp5shop]# rsync -av /usr/local/nginx/html/tp5shop root@192.168.17.109:/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 root@192.168.17.109:/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默认一分钟。不能实时进行同步。

相关推荐
酷可达拉斯12 分钟前
Linux操作系统-简单内核优化
linux·git·php
码上上班17 分钟前
Filebeat课程
linux
weixin_5160230742 分钟前
LAMMPS(intel)的安装
linux·服务器
代码AC不AC43 分钟前
【Linux】Socket编程UDP
linux·udp·socket编程
MMendex1 小时前
Nginx_day4——uWSGI,灰度发布,网站限流限速,Nginx跨域
运维·nginx
小小测试开发1 小时前
RAG检索评测实战:9种架构对比与自动化评估框架搭建
运维·人工智能·python·自动化
zzz_23681 小时前
智慧社区项目全维度测试报告:功能、接口、自动化与性能验证
运维·自动化
Brilliantwxx1 小时前
【Linux】基础指令
linux·运维·服务器
ZhemgLee1 小时前
在Linux上使用Claude Code 并使用本地VS Code SSH远程访问的完整指南
linux·运维·服务器·ssh
CHANG_THE_WORLD1 小时前
4.串行接受多个客户端
linux