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

相关推荐
Once_day1 小时前
Linux之rsyslog(6)RainerScript
linux·服务器·syslog
Shylock_Mister2 小时前
Linux C线程编程全指南
linux·运维·c语言
心灵宝贝2 小时前
CentOS 7 安装 unzip-6.0-21.el7.x86_64.rpm 步骤详解(附安装包)
linux·服务器·centos
q***13342 小时前
在linux(Centos)中Mysql的端口修改保姆级教程
linux·mysql·centos
Autism....2 小时前
服务器理解
运维·服务器
Starry_hello world2 小时前
Linux 文件缓冲区
linux
天亮之前_ict3 小时前
【故障排查】intel 服务器安装Win server 2019蓝屏解决方法
运维·服务器
牢七3 小时前
操作系统。
linux
SongYuLong的博客3 小时前
openwrt源码编译环境搭建-安装Luci
linux·嵌入式硬件
熙客3 小时前
Linux:监控命令
linux·运维