Rsync on Windows: wrong permissions for created directories

user391986 picture user391986 · Apr 27, 2011 · Viewed 38.3k times · Source

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/ [email protected]:/srv/www/prj112/myfolder/

/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?

Answer

Lars Wiegman picture Lars Wiegman · May 6, 2011

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

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

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

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