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

相关推荐
CYRUS_STUDIO17 小时前
用 Frida 控制 Android 线程:kill 命令、挂起与恢复全解析
android·linux·逆向
熊猫李19 小时前
rootfs-根文件系统详解
linux
chen94520 小时前
mysql 3节点mgr集群部署
运维·后端
LH_R21 小时前
OneTerm开源堡垒机实战(三):功能扩展与效率提升
运维·后端·安全
dessler21 小时前
Hadoop HDFS-高可用集群部署
linux·运维·hdfs
泽泽爱旅行21 小时前
awk 语法解析-前端学习
linux·前端
少妇的美梦2 天前
logstash教程
运维
chen9452 天前
k8s集群部署vector日志采集器
运维
chen9452 天前
aws ec2部署harbor,使用s3存储
运维
轻松Ai享生活2 天前
5 节课深入学习Linux Cgroups
linux