当前位置:   首页安装配置rsync只同步目录结构不同步文件的方法

rsync只同步目录结构不同步文件的方法

发布日期:2022-08-11 12:27 | 文章来源:脚本之家

If you are using an older rsync version, try:

复制代码 代码如下:

rsync -av --include='*/' --exclude='*' /path/to/src /path/to/dest/
rsync -av --include='*/' --exclude='*' /path/to/apache/logs/ root@www433.nixcraft.net.in:/path/to/apache/logs/

# cd /var/log/apache/
# rsync -av -f"+ */" -f"- *" . root@server2.nixcraft.com:/var/log/apache/

Sample outputs:

building file list ... done
./
cricketnow.in/
cyberciti.biz/
hexindia.net/
io9.in/
nixcraft.com/
theos.in/
sent 388 bytes received 98 bytes 972.00 bytes/sec
total size is 0 speedup is 0.00

You can also make local copies as follows:
# cd /var/log/apache/
# rsync -av -f"+ */" -f"- *" . /jailfs/apache/httpd_root/var/log/apache/


联系我们
关于使用场景和技术架构的更多咨询,请联系我们的销售和技术支持团队。
Yingsoo Host

在线
客服

在线客服:7*24小时在线

客服
热线

400-630-3752
7*24小时客服服务热线

关注
微信

关注官方微信
顶部