cwRsync 忽略“nontsec”在 Windows 7 上
我使用 cwRsync 将一些文件从 Windows 同步到 Ubuntu。这个过程过去在 Vista 上运行得很好,但自从我升级到 Windows7 后,我不断遇到权限问题。
一些背景...我确实在 Vista 上遇到过相同的权限问题,但这是通过使用 CYGWIN=nontsec 环境变量解决的。
预授权问题
rsync: failed to modify permissions on xxx: Permission denied (13)
由于 Windows 和 UNIX 文件权限不同,因此将文件与 Windows 权限同步是没有意义的。 rsync 的作用是将 UNIX 端的权限设置为 0 (d---------
)。为了防止这种情况,cygwin 有 nontsec
变量,指示它忽略 Windows 文件权限。
问题是,在 Windows7 上,nontsec
似乎没有任何效果。
I use cwRsync to sync up some file from Windows to Ubuntu. This process used to work fine on Vista, but since I upgraded to Windows7, I keep getting permission issues.
Some background... I did use to get the same permission issues on Vista, but that was resolved by using the CYGWIN=nontsec
environment variable.
The premission problem
rsync: failed to modify permissions on xxx: Permission denied (13)
Since windows and UNIX file permissions differ, sync'ing files with windows permissions doesn't make sense. What rsync does is set the permission on the UNIX side to 0 (d---------
). To prevent this, cygwin has the nontsec
variable which instructs it to ignore the windows file permissions.
The problem is, on Windows7, nontsec
appears not to have any effect.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
对于您的解决方案,我必须进行调整才能看到它对我有用 - 我使用了您引用的论坛主题中的内容,而不是您的 etc/fstab 内容:
我正在使用 cwRsync 安装程序 4.0.3。我很高兴它对我有用,但我无法提供原因,因为我对 fstab 语法和选项不够熟悉。希望它能为其他人添加一些有用的东西。
re your solution, I had to make an adjustment to see it work for me - instead of your etc/fstab content, I used this content from the forum topic you reference:
I'm using cwRsync installer 4.0.3. I'm happy enough that it works for me but I can't offer a reason why, not being familiar enough with fstab syntax and options. Hopefully it adds something useful to someone else.
我发现问题不是由 Windows 7 引起的。相反,新版本的 cwrsync 忽略了 nontsec 环境变量。对于高于1.7的cwRsync版本,您需要使用
noacl
选项。 (参见论坛主题:无法访问 RSYNC 备份文件夹的子文件夹)解决方案涉及使用
noacl
选项创建一个fstab
文件:就是这样!您还可以删除 CYGWIN=nontsec 环境变量,因为它不再使用。
I figured out that it wasn't Windows 7 that was causing the issue. Rather, it was the new version of cwrsync that was ignoring the
nontsec
environment var. For cwRsync versions higher than 1.7, you need to use thenoacl
option. (see forum topic: No access to subfolders of RSYNC backup folder)The solution involves creating an
fstab
file with thenoacl
option:And that's it! You can also remove the
CYGWIN=nontsec
env var since it's no longer used.我在从基于 Solaris 的 Web 主机复制到本地 PC 时遇到了同样的问题。当文件被复制下来时,PC权限被破坏。我设置了 fstab 文件,但没有成功。
最后我意识到我正在对 rsync.exe 进行完整路径调用,这意味着我当前的目录没有选取我刚刚创建的 etc 文件夹。为了解决这个问题,我在 rsync 命令的调用上方添加了这些行,并且它运行得很好。
现在,我的文件权限已正确默认为父文件夹权限,没有任何问题。
我只是想将其标记到此线程上,以防将来其他人遇到与我相同的问题。
I was having this same problem copying from my Solaris based webhost down to my local PC. The PC permissions were wacked when the files were copied down. I setup the fstab file but no go.
In the end I realized that I was making a full path call to rsync.exe which meant my current directory was no picking up the etc folder I just created. To resolve this, I added these lines just above the call to the rsync command and it worked perfectly.
Now my file permissions are correctly defaulting to the parent folder permissions without issues.
I just wanted to tag this onto this thread in case anyone else in the future is coming across the same issue I was.
现在 cwrsync 常见问题解答中也解决了这个问题:
http://www.itefix.no/i2/node/11324
我也可以举报常见问题解答中的修复(以及 Raise 的答案)也对我有用。
This is now also addressed in the cwrsync FAQ:
http://www.itefix.no/i2/node/11324
I can also report the fix in the FAQ (and Raise's answer) worked for me as well.
我遇到了同样的问题,但没有一个解决方案对我有用,直到我意识到我的目标文件夹位于 rsync 文件夹之外。 (我想将文件从 Linux 同步到 Windows。)
以下是对我有用的方法:
在 cwRsync 文件夹中创建一个子目录
etc
(即rsync.exe< 所在的位置) /code> 所在)。
在该文件夹内创建一个名为
fstab
(无后缀)的文件。在
fstab
文件中插入一行,确保具有 UNIX 行结尾!设置环境:
在启动 rsync.exe 之前(这是我的情况中最重要的一步):
SET HOME
部分对于 SSH 很重要,它将创建一个.ssh
子文件夹中包含一个known_hosts
文件。I had the same problem, but none of the solutions worked for me, until I realized my destination folder was outside the rsync folder. (I wanted to rsync files from Linux to Windows.)
Here is what worked for me:
Create a subdir
etc
inside the cwRsync folder (that is, where thersync.exe
resides).Create a file named
fstab
(no suffix) inside that folder.Insert one line into that
fstab
file, be sure to have UNIX line endings!Set environment:
Before starting rsync.exe (this was the most important step in my case):
The
SET HOME
part is important for SSH, it will create a.ssh
subfolder there with aknown_hosts
file.