11

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.

anushr
  • 3,342
  • 3
  • 29
  • 50

5 Answers5

7

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.

Raise
  • 2,034
  • 1
  • 13
  • 12
  • 1
    Yours might well be the right answer too. I'm not that familiar with the fstab options either, so I just put down whatever worked for me. I think the important option to use is the `noacl`. The rest may be different based on your specific choices. – anushr Feb 01 '10 at 18:32
2

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.

anushr
  • 3,342
  • 3
  • 29
  • 50
2

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.

Erik
  • 66
  • 1
2

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.

hvuoltee
  • 408
  • 4
  • 8
  • I wish this fixed it, but it's not helping for me. Perhaps my fstab is not in the correct location or something. – Simon East May 29 '17 at 03:58
1

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.

Simon East
  • 55,742
  • 17
  • 139
  • 133
Bianka M.
  • 396
  • 3
  • 4