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

相关推荐
123过去27 分钟前
hashid使用教程
linux·网络·测试工具·安全
C+++Python40 分钟前
Linux/C++多进程
linux·运维·c++
最贪吃的虎41 分钟前
GitHub推送又超时了?试试SSH
运维·ssh·github
XZY0281 小时前
如何使用grpc
运维·服务器
rleS IONS1 小时前
SQL2000在win10上安装的方法
运维·服务器
Stack Overflow?Tan901 小时前
linux ubuntu22.04安装ROS2humble完整版的流程
linux·docker·ros2
zly35001 小时前
centos7 sshd无法启动
linux·运维·服务器
IMPYLH2 小时前
Linux 的 hostid 命令
linux·运维·服务器·bash
编程大师哥2 小时前
Linux 命名管道(FIFO)通信 超清晰讲解
linux·运维·服务器
Smile_2542204183 小时前
linux服务器清理磁盘
linux·运维·服务器