Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using CwRsync to connect from my Windows development machine to a linux webserver :

rsync -avuz -e ./ssh --exclude=".svn" /cygdrive/c/xampp/htdocs/project123/ user123@project123.com:/home/user123/public_html

This syncs my development project directory nicely and fast to the server.

But after doing this, all directory properties are reset to the local user user123 only, so the website is not available anymore. I need to manually reset those properties.

Why is this happening, and how to prevent it?

PS. coming from a Windows environment I'm having a really hard time understanding rsync. I copied the above command from some examples... just need to get this one small thing working too...

share|improve this question

1 Answer 1

It depends on what you mean by "properties".

  • Permissions? The -p (--perms) option should preserve them. It is automatically enabled when using -a, though, so if permissions are lost it might be caused by CwRsync itself.

    Make sure (using Cygwin's ls and chmod) that the local permissions are correct. Alternatively, try the --no-perms option.

  • Ownership? On Unix systems, users are not allowed to change file ownership. If you log in as user123 and create a file, it will be owned by user123, period. Similar restrictions exist for groups – you can change a file's group, but only if you are in that group yourself.

  • Something else?

share|improve this answer
    
I meant permissions (in my FTP software this is called properties, so I thought that was the word :). It seems the Group and World permissions are set to 0 by rsync. What do you mean with local permissions? The source is a Windows machine... I'll try your tips first. –  Dylan Aug 22 '11 at 17:09
    
@Dylan: Windows too has file permissions (called ACLs), more complex than those of Unix. When using CwRsync, the Cygwin layer attempts to translate Windows ACLs to Unix permissions, which are then copied by rsync to the remote server. Play around with icacls on Windows, perhaps try icacls C:\xampp\htdocs\project123 /grant everyone:(oi)(ci)(rx). –  grawity Aug 22 '11 at 17:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.