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默认一分钟。不能实时进行同步。

相关推荐
LI JS@你猜啊4 小时前
liunx版本的
运维·jenkins
明长歌4 小时前
【docker】docker registry搭建私有镜像仓库
运维·docker·容器
weixin_428498495 小时前
Linux上并行打包压缩工具
linux
Estar.Lee6 小时前
MySQL中外键约束详解 外键在表关系维护中的作用
运维·数据库·mysql·api·免费api
藥瓿亭7 小时前
K8S认证|CKS题库+答案| 11. AppArmor
运维·服务器·docker·云原生·容器·kubernetes·cks
胖大和尚7 小时前
Linuxkernel学习-deepseek-2
linux
we199898987 小时前
Linux:守护进程(进程组、会话和守护进程)
linux·运维·服务器
无脑学c++7 小时前
在Ubuntu上使用 dd 工具制作U盘启动盘
linux·运维·ubuntu
南棱笑笑生8 小时前
20250611在全志H3平台的Nano Pi NEO CORE开发板上运行Ubuntu Core16.04时让4G模块EC200A-CN使用AT命令拨号上网
linux·数据库·ubuntu
SimpleForest8 小时前
ubuntu 系统分区注意事项
linux·ubuntu·分区