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

相关推荐
想唱rap41 分钟前
Linux开发工具(4)
linux·运维·服务器·开发语言·算法
weixin_537765801 小时前
【Nginx优化】性能调优与安全配置
运维·nginx·安全
robin59111 小时前
Linux-通过端口转发访问数据库
linux·数据库·adb
视觉AI1 小时前
如何查看 Linux 下正在运行的 Python 程序是哪一个
linux·人工智能·python
Lisonseekpan1 小时前
为什么国内禁用docker呢?
运维·docker·容器
扣脚大汉在网络2 小时前
如何在centos 中运行arm64程序
linux·运维·centos
lang201509282 小时前
Linux命令行:cat、more、less终极指南
linux·chrome·less
攒钱植发3 小时前
嵌入式Linux——“大扳手”与“小螺丝”:为什么不该用信号量(Semaphore)去模拟“完成量”(Completion)
linux·服务器·c语言
三五度3 小时前
vmware的ubuntu20.04无网络图标
linux·ubuntu
R-G-B3 小时前
【P1】win10安装 Docker教程
运维·docker·容器