0

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/ [email protected]:/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...

1
  • 1
    Which user is running the rsync command? From the rsync man page: -o, --owner preserve owner (super-user only) Mar 27, 2018 at 5:15

1 Answer 1

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?

2
  • 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, 2011 at 17:09
  • 1
    @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). Aug 22, 2011 at 17:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .