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

相关推荐
无敌小茶19 分钟前
Linux学习笔记之环境变量
linux·笔记
Harbor Lau32 分钟前
Linux常用中间件命令大全
linux·运维·中间件
漫谈网络1 小时前
基于 Netmiko 的网络设备自动化操作
运维·自动化·netdevops·netmiko
꧁坚持很酷꧂1 小时前
Linux Ubuntu18.04下安装Qt Craeator 5.12.9(图文详解)
linux·运维·qt
凉、介2 小时前
PCI 总线学习笔记(五)
android·linux·笔记·学习·pcie·pci
电鱼智能的电小鱼2 小时前
EFISH-SBC-RK3588无人机地面基准站项目
linux·网络·嵌入式硬件·机器人·无人机·边缘计算
电鱼智能的电小鱼2 小时前
基于 EFISH-SBC-RK3588 的无人机环境感知与数据采集方案
linux·网络·嵌入式硬件·数码相机·无人机·边缘计算
小诸葛的博客3 小时前
详解Linux中的定时任务管理工具crond
linux·运维·chrome
一默19913 小时前
CentOS 7.9升级OpenSSH到9.9p2
linux·运维·centos
keep intensify3 小时前
Linux常用指令
linux·服务器·php