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@192.168.1.110:/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?
NewtonianBAsked:
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.
0
 
farzanjCommented:
Try
rsync -av <SOURCE_DIR> rsyncuser@192.168.1.110:/srv/www/prj112/myfolder

I am not sure on Windows side about the source path.
0
 
LinuxNinjaCommented:
If you're attempting to maintain permissions, use -avz instead of -rvz.
I use rsync daily, but not from cygwin.
0
 
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
http://cygwin.com/ml/cygwin/2007-08/msg00489.html

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

From novice to tech pro — start learning today.