If you want to force the permissions at the destination, you'll need to use the --chmod
option and/or the --perms
option.
--chmod
overrides the source permissions (ie rsync pretends that the source permissions are whatever you specify instead of what they actually are)
--perms
(or -p
) forces the source permissions onto the destination server
For example:
rsync --chmod=a=r,u+w,D+x -p -r /cygdrive/c/xampp/htdocs/mysite/* \
[email protected]:/home/mysite/public_html/
You didn't mention what cygwin considers the source permissions to be (ie an ls -l /cygdrive/c/xampp/htdocs/mysite/*
in cygwin) or what the actual permissions wind up being on the destination side. If we knew that, it might be possible to construct something a bit simpler.
For a thorough illumination of the various options, consult the very-detailed rsync manpage.
Note that rsync does not yet support octal permissions (eg --chmod=644
). According to this post, support for that will be available in rsync 3.1.0.