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

相关推荐
暗恋 懒羊羊4 分钟前
Linux 生产者消费者模型
linux·开发语言·ubuntu
安红豆.1 小时前
Linux基础入门 --13 DAY(SHELL脚本编程基础)
linux·运维·操作系统
..空空的人1 小时前
linux基础指令的认识
linux·运维·服务器
penny_tcf1 小时前
Linux基础命令halt详解
linux·运维·服务器
万界星空科技2 小时前
界星空科技漆包线行业称重系统
运维·经验分享·科技·5g·能源·制造·业界资讯
荣世蓥2 小时前
10.2 Linux_进程_进程相关函数
linux·运维·服务器
gma9993 小时前
【MySQL】服务器管理与配置
运维·服务器
henan程序媛3 小时前
Jenkins Pipline流水线
运维·pipeline·jenkins
安全不再安全3 小时前
Linux 安装 yum
linux·运维·centos
水饺编程3 小时前
【英特尔IA-32架构软件开发者开发手册第3卷:系统编程指南】2001年版翻译,1-2
linux·嵌入式硬件·fpga开发