免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 6599 | 回复: 9
打印 上一主题 下一主题

请教一个rsync的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-07-12 16:12 |显示全部楼层 |倒序浏览
大家好,最近我在工作中遇到一个十分诡异的问题,具体是这样子的。
  1. rsync -azv -e "ssh -p 22 -1 -o StrictHostKeyChecking=no" w4.ynews:"/home/logs/nd/access-2010-07-11-06*.gz /home/logs/nd/access-2010-07-11-18*.gz /home/logs/nd/access-2010-07-12-00*.gz" /filer/udc/daily/20100711/w4.ynews/fe/
  2. receiving file list ... done
  3. ./
  4. .ssh/
  5. .ssh/authorized_keys

  6. sent 36 bytes  received 699 bytes  1470.00 bytes/sec
  7. total size is 1003  speedup is 1.36
复制代码


在w4.ynews这台服务器上并没有/home/logs/nd目录,不知道为什么这个命令不报错误,反而将w4.ynews的个人目录下的.ssh拷贝过来了,请问大家有遇到过这种问题么,盼回复~~

论坛徽章:
0
2 [报告]
发表于 2010-07-12 16:28 |显示全部楼层
我又做了一个测试
  1. rsync -azv -e "ssh -p 22 -1 -o StrictHostKeyChecking=no" yahoo@w4.ynews:/home/logs/nd  /filer/udc/daily/20100711/w4.ynews/

  2. receiving file list ... rsync: link_stat "/home/y/logs/yapache/nd" failed: No such file or directory (2)
  3. done
  4. client: nothing to do: perhaps you need to specify some filenames or the --recursive option?
  5. rsync error: some files could not be transferred (code 23) at main.c(723)
复制代码
nd目录不存在,我如果直接rsync nd目录的话,就会提示"No such file or directory".

论坛徽章:
0
3 [报告]
发表于 2010-07-13 09:55 |显示全部楼层
回复 3# lonelysoul011

手动创建这个目录是没有这个问题的,rsync会报错提示目录或者文件不存在,现在的问题就是如果这个目录不存在,我rsync的时候,他竟然把.ssh目录rsync过来,命令也不会报错。

论坛徽章:
0
4 [报告]
发表于 2010-07-13 09:56 |显示全部楼层
没明白想表明啥意思.
wild_li 发表于 2010-07-12 22:17


我的意思就是说rsync的时候,如果目录不存在应该报错才对,可是不明白这个rsync为啥目录没有,他不报错,竟然将home目录下的.ssh目录拷贝过来了呢?

论坛徽章:
0
5 [报告]
发表于 2010-07-13 10:01 |显示全部楼层
大家好,最近我在工作中遇到一个十分诡异的问题,具体是这样子的。


在w4.ynews这台服务器上并没有/hom ...
angeler 发表于 2010-07-12 16:12


进一步定位发现,应该是和通配符'*'有关系,如果我将*去掉,命令就比较正常了。难道是rsync的bug?

论坛徽章:
0
6 [报告]
发表于 2010-07-13 10:28 |显示全部楼层
问题进一步定位,本地系统为linux 32位,w4.ynews为linux 64位。我又测试了一下linux 32位到linux32位的和Linux 32位 和BSD的,都没有问题。难道是linux 32位和64位之间某些东东不兼容?

论坛徽章:
0
7 [报告]
发表于 2010-07-13 11:45 |显示全部楼层
参考远程shell对word-splitting的解释。
blackold 发表于 2010-07-13 10:54


感谢您的回复,您能说的更详细一些么,具体这个命令是在哪个地方word-splitting出现问题,我也好比较方便的入手。

论坛徽章:
0
8 [报告]
发表于 2010-07-13 13:58 |显示全部楼层
回复  angeler


    还没碰到过这种问题。

你可以试试:或者

逐个测试,看看问题出在哪里
blackold 发表于 2010-07-13 12:46


本地服务器是Linux 32位,w4.ynews是Linux 64位,w5.ynews也是Linux 64位,w1.ynews是BSD的。

以下是Linux 32位与Linux 64位之前rsync命令
  1. rsync -azv -e "ssh -p 22 -1 -o StrictHostKeyChecking=no" w5.ynews:"/home/logs/nd/access-2010-07-11-06*.gz /home/logs/nd/access-2010-07-11-18*.gz /home/logs/nd/access-2010-07-12-00*.gz" /filer/udc/daily/20100711/w5.ynews/fe/
  2. receiving file list ... done
  3. ./
  4. .ssh/
  5. .ssh/authorized_keys

  6. sent 36 bytes  received 699 bytes  1470.00 bytes/sec
  7. total size is 1003  speedup is 1.36
复制代码
以下是Linux 32位与BSD之间rsync命令
  1. rsync -azv -e "ssh -p 22 -1 -o StrictHostKeyChecking=no" w1.ynews:"/home/logs/nd/access-2010-07-11-06*.gz /home/logs/nd/access-2010-07-11-18*.gz /home/logs/nd/access-2010-07-12-00*.gz" /filer/udc/daily/20100711/w1.ynews/fe/
  2. receiving file list ... rsync: link_stat "/home/logs/nd/access-2010-07-11-06*.gz" failed: No such file or directory (2)
  3. rsync: link_stat "/home/logs/nd/access-2010-07-11-18*.gz" failed: No such file or directory (2)
  4. rsync: link_stat "/home/logs/nd/access-2010-07-12-00*.gz" failed: No such file or directory (2)
  5. done
  6. client: nothing to do: perhaps you need to specify some filenames or the --recursive option?
  7. rsync error: some files could not be transferred (code 23) at main.c(723)
复制代码

论坛徽章:
0
9 [报告]
发表于 2010-07-13 15:21 |显示全部楼层
回复  angeler


    不带-e的命令测试过吗?
blackold 发表于 2010-07-13 15:03
  1. rsync -azv  w4.ynews:"/home/logs/nd/access-2010-07-11-06*.gz /home/logs/nd/access-2010-07-11-18*.gz /home/logs/nd/access-2010-07-12-00*.gz" /filer/udc/daily/20100711/w5.ynews/fe/
  2. receiving file list ... done
  3. ./
  4. .ssh/
  5. .ssh/authorized_keys

  6. sent 36 bytes  received 699 bytes  1470.00 bytes/sec
  7. total size is 1003  speedup is 1.36
复制代码
我ssh version默认是2,如果不带-e只能将ssh version默认改为1了,呵呵,不过不带-e仍然是这样子的。

论坛徽章:
0
10 [报告]
发表于 2010-07-15 13:19 |显示全部楼层
回复 15# blackold

恩,我再自己测试一下吧,非常感谢您的回复
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP