rsync permission denied created directories have no permissions

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/ rsyncuser@

/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?
Who is Participating?
farzanjConnect With a Mentor Commented:
This command would work on Linux at least.  Note that rsync does not need to mention ssh--at least on Linux.
rsync -av <SOURCE_DIR> rsyncuser@

I am not sure on Windows side about the source path.
If you're attempting to maintain permissions, use -avz instead of -rvz.
I use rsync daily, but not from cygwin.
NewtonianBAuthor Commented:
respect farzanj!!!!! that worked i don't know why the other way had all these permission issues. WIth the other way after every pass it would create a directory level, then on the server i would do a chmod -R 775 then when i reran rsync it would again be able to sync one level deeper and so on as I had to fix all permission issues.
I've been reading this post which is essentially

anyways amazing thanks again
You are most welcome.  Glad it worked.
All Courses

From novice to tech pro — start learning today.