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

相关推荐
GKDf1sh12 分钟前
通过qemu仿真树莓派系统调试IoT固件和程序
linux·网络·物联网·qemu
一匹电信狗12 分钟前
浅谈Linux中的Shell及其原理
linux·服务器·c语言·开发语言·c++·ssh·unix
SAP-ZX31 分钟前
SAP IBP for Supply Chain Certification Guide (Parag Bakde, Rishabh Gupta)
运维
IT 小旋风34 分钟前
Linux系统安全及应用
linux·运维·系统安全
泡泡里的月亮34 分钟前
【docker】Windows10启动Docker Desktop - WSL update failed
运维·docker·语言模型·容器
wjf630001 小时前
CentOS 7 系统上安装 SQLite
linux·运维·centos
软件聚导航1 小时前
在centOS Linux系统搭建自动化构建工具Jenkins
linux·centos·自动化
程序视点2 小时前
Linux内核与基础命令学习总结
linux·后端
pp-周子晗(努力赶上课程进度版)2 小时前
Linux 进程的创建、终止、等待与程序替换函数 保姆级讲解
linux·运维·服务器
郁大锤2 小时前
ubuntu 24.04(linux)安装 jetbrains IntelliJ IDEA,设置图标
linux·ubuntu·intellij-idea·图标