cwRsync 忽略“nontsec”在 Windows 7 上

发布于 2024-08-19 03:35:47 字数 521 浏览 3 评论 0原文

我使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

自演自醉 2024-08-26 03:35:47

对于您的解决方案,我必须进行调整才能看到它对我有用 - 我使用了您引用的论坛主题中的内容,而不是您的 etc/fstab 内容:

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

我正在使用 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:

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

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.

海的爱人是光 2024-08-26 03:35:47

我发现问题不是由 Windows 7 引起的。相反,新版本的 cwrsync 忽略了 nontsec 环境变量。对于高于1.7的cwRsync版本,您需要使用noacl选项。 (参见论坛主题:无法访问 RSYNC 备份文件夹的子文件夹)

解决方案涉及使用 noacl 选项创建一个 fstab 文件:

# In this example, my cwRsync dir is located at: "C:/Program Files (x86)/cwRsync"
# Filename: "C:/Program Files (x86)/cwRsync/etc/fstab"
C:/Program\040Files\040(x86)/cwRsync / ntfs override,binary,noacl 0 0
C:/Program\040Files\040(x86)/cwRsync/bin /usr/bin ntfs override,binary,noacl 0 0

就是这样!您还可以删除 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 the noacl option. (see forum topic: No access to subfolders of RSYNC backup folder)

The solution involves creating an fstab file with the noacl option:

# In this example, my cwRsync dir is located at: "C:/Program Files (x86)/cwRsync"
# Filename: "C:/Program Files (x86)/cwRsync/etc/fstab"
C:/Program\040Files\040(x86)/cwRsync / ntfs override,binary,noacl 0 0
C:/Program\040Files\040(x86)/cwRsync/bin /usr/bin ntfs override,binary,noacl 0 0

And that's it! You can also remove the CYGWIN=nontsec env var since it's no longer used.

强辩 2024-08-26 03:35:47

我在从基于 Solaris 的 Web 主机复制到本地 PC 时遇到了同样的问题。当文件被复制下来时,PC权限被破坏。我设置了 fstab 文件,但没有成功。

最后我意识到我正在对 rsync.exe 进行完整路径调用,这意味着我当前的目录没有选取我刚刚创建的 etc 文件夹。为了解决这个问题,我在 rsync 命令的调用上方添加了这些行,并且它运行得很好。

SET CWRSYNCHOME=%PROGRAMFILES%\CWRSYNC
c:
cd %CWRSYNCHOME%

现在,我的文件权限已正确默认为父文件夹权限,没有任何问题。

我只是想将其标记到此线程上,以防将来其他人遇到与我相同的问题。

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.

SET CWRSYNCHOME=%PROGRAMFILES%\CWRSYNC
c:
cd %CWRSYNCHOME%

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.

空城仅有旧梦在 2024-08-26 03:35:47

现在 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.

很快妥协 2024-08-26 03:35:47

我遇到了同样的问题,但没有一个解决方案对我有用,直到我意识到我的目标文件夹位于 rsync 文件夹之外。 (我想将文件从 Linux 同步到 Windows。)

以下是对我有用的方法:

  1. 在 cwRsync 文件夹中创建一个子目录 etc(即 rsync.exe< 所在的位置) /code> 所在)。

  2. 在该文件夹内创建一个名为 fstab(无后缀)的文件。

  3. fstab 文件中插入一行,确保具有 UNIX 行结尾!

    无 /cygdrive cygdrive 二进制,posix=0,用户,noacl 0 0
    
  4. 设置环境:

    SET CWRSYNCHOME=
    SET HOME=<保存用户配置文件的目录,如 sshknown_hosts>;
    
  5. 在启动 rsync.exe 之前(这是我的情况中最重要的一步):

    cd <目标文件夹>
    

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:

  1. Create a subdir etc inside the cwRsync folder (that is, where the rsync.exe resides).

  2. Create a file named fstab (no suffix) inside that folder.

  3. Insert one line into that fstab file, be sure to have UNIX line endings!

    none /cygdrive cygdrive binary,posix=0,user,noacl 0 0
    
  4. Set environment:

    SET CWRSYNCHOME=<cwRsync installation path>
    SET HOME=<Directory to save user configuration files, like ssh known_hosts>
    
  5. Before starting rsync.exe (this was the most important step in my case):

    cd <Destination folder>
    

The SET HOME part is important for SSH, it will create a .ssh subfolder there with a known_hosts file.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文