views:

935

answers:

6

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.

A: 

I have noticed the same problem. This nontsec option for cygwin (or at least in the case of cwRsync) does not appear to have any effect on Windows 7 or Windows Server 2008. If anyone has a solution to fix this, I would love to know also!

Kendall Bennett
A: 

I have the same problem, switched to Windows 7, and since than the permissions are changed on each sync. Very annoying. Anybody any idea ?

Toni Van de Voorde
+1  A: 

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
+2  A: 

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
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
A: 

Any news arround the question? So far i have still the problem (win7 ult 32 bit client; cwrsync 4.04)

  • creating fstab file doesn´t help

If i run a rsync, i loose all permission on the target dir (d---------)

The symptom not occured from the beginning and not all my backup folder are affected. At the moment i lost the trust in rsync; i switched to robocopy

Could it be possible that the server side plays a role. My targets are located on a Strato hidrive webdrive which supports rsync as protocol.

Where have you created the `fstab` file? It should be in `C:\Program Files\cwRsync\etc\`
Raise
A: 

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

related questions