Windows 上的 Rsync:创建的目录的权限错误 [英] Rsync on Windows: wrong permissions for created directories

查看:39
本文介绍了Windows 上的 Rsync:创建的目录的权限错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 rsync 通过 windows (cygwin) 上的 ssh 将更改推送到我的服务器.我使用的命令是:

I'm trying to push changes to my server through ssh on windows (cygwin) using rsync. The command I am using is:

rsync -rvz -e ssh/cygdrive/c/myfolder/rsyncuser@192.168.1.110:/srv/www/prj112/myfolder/

rsync -rvz -e ssh /cygdrive/c/myfolder/ rsyncuser@192.168.1.110:/srv/www/prj112/myfolder/

/srv/www/prj112/myfolder/rsyncuser 所有.我的问题是,尽管使用 rsync 子目录是在发布时创建的,但每个目录都被分配了 d--------- 的默认权限,所以 rsync 无法复制其中的任何文件.

/srv/www/prj112/myfolder/ is owned by rsyncuser. My problem is that eventhough with rsync the sub directories are create as they publish, each directory is assigned default permission of d--------- so rsync fails to copy any files inside it.

我该如何解决这个问题?

How do I fix this?

推荐答案

忽略 NTFS 权限的选项在 Cygwin 1.7 版中已更改.这可能是导致问题的原因.

The option to ignore NTFS permissions has changed in Cygwin version 1.7. This might be what's causing the problem.

尝试将 'noacl' 标志添加到 C:\cygwin\etc\fstab 中的 Cygwin 挂载,例如:

Try adding the 'noacl' flag to your Cygwin mounts in C:\cygwin\etc\fstab, for example:

none /cygdrive cygdrive user,noacl,posix=0 0 0

您可以使用 'chmod' 选项通过 rsync 传递自定义权限:

You can pass custom permissions via rsync using the 'chmod' option:

rsync -rvz --chmod=ugo=rwX -e ssh source destination

这篇关于Windows 上的 Rsync:创建的目录的权限错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆