RSync 仅复制文件夹目录结构而不复制文件
我正在使用 RSync 将 tar 球复制到 Windows XP 计算机上的外部硬盘驱动器。
我的文件是目录(权限 711)中的 tar.gz 文件(权限 600)。
但是,当我进行试运行时,仅返回文件夹,而忽略文件。
- 我经常使用 RSync,所以我认为我的安装没有问题。
- 我已尝试更改文件的权限,但这没有什么区别
- 文件的所有者是 root,这也是脚本登录的用户,因为
- 我没有使用 Rsync 的 CVS 选项
我使用的命令是:
rsync^
-azvr^
--stats^
--progress^
-e 'ssh -p 222' root@servername:/home/directory/ ./
我有什么东西吗?缺少复制我的文件吗?
I am using RSync to copy tar balls to an external hard drive on a Windows XP machine.
My files are tar.gz files (perms 600) in a directory (perms 711).
However, when I do a dry-run, only the folders are returned, the files are ignored.
- I use RSync a lot, so I presume there is no issue with my installation.
- I have tried changing permissions of the files but this makes no difference
- The owner of the files is root, which is also the user which the script logs in as
- I am not using Rsync's CVS option
The command I am using is:
rsync^
-azvr^
--stats^
--progress^
-e 'ssh -p 222' root@servername:/home/directory/ ./
Is there something I am missing to get my files copied over?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只能想到一种可能性:我对 rsync 的经验是,它在复制文件之前创建目录结构。Rsync 可能会提前终止,但在此目录步骤完成之后。
Update0
您提到您正在进行试运行。默认情况下,当接收器上不存在目录及其所有内容时,Rsync 仅显示目录名称。
经过大量实验后,如果源上的目录的修改日期比接收器上的目录晚,我只能重现您所描述的行为。在这种情况下,修改时间在接收器上进行调整。
I can think of only a single possibility: My experience with rsync is that it creates the directory structure before copying files in. Rsync may be terminating prematurely, but after this directory step has been completed.
Update0
You mentioned that you were running dry run. Rsync by default only shows the directory names when the directory and all its contents are not present on the receiver.
After a lot of experimentation, I'm only able to reproduce the behaviour you describe if the directories on the source have later modification dates than on the receiver. In this instance, the modification times are adjusted on the receiver.
我也遇到了这个问题,事实证明,从 Linux 备份到 Windows 驱动器似乎并没有在临时文件传输完毕后将其复制到位。
当 rsync 到 Windows 驱动器时,尝试添加 --inplace 标志。
I had this problem too, and it turns out that backing up to a windows drive from linux doesn't seem to copy the temp files in place, after they are transferred over.
Try adding the --inplace flag, when rsyncing to windows drives.