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

相关推荐
小豆庄22 分钟前
自动化内容分发的架构选型:自建脚本、外包还是工具平台?
运维·容器·架构·自动化·go·需求分析
天远API23 分钟前
零信任架构实战:基于天远车辆过户详版查询构建自动化二手车残值估值网关
运维·人工智能·架构·自动化
迈威通信1 小时前
MICF600S-2F工业CAN光纤转换器技术解析:光纤远传、环网自愈与云边协议互通
运维·网络·架构·信息与通信
EmbeddedChen3 小时前
Linux Shell 脚本入门:写一个自动备份文件的小工具
linux·bash·shell
志栋智能3 小时前
超自动化安全的报告自动生成与分发
运维·安全·自动化
开开心心就好6 小时前
定时结束进程的小工具,到点还能关机
linux·运维·服务器·智能手机·pdf·电脑·word
风翼靓崽6 小时前
ansible
linux·运维·ansible
遨游DATA6 小时前
容器退出码 126 排查:静态资源镜像层如何改写目录权限
linux·docker·kubernetes·文件权限
笔记本note6 小时前
Linux 定时器与时间管理
linux·时间·定时器
NPE~7 小时前
.sock 文件入门:从“文件路标”到进程间通信
linux·macos·教程·基础知识·.sock