On Wed, Oct 08, 2003 at 07:57:07PM +1000, BlakJak wrote:> Using rsync to copy files on the localhost, the group is being preserved
> even though I have not used the -g or -a options.
>
> My source files:
> $ ls -l ~/working/source/path
> -rwxr-xr-x 1 blakjak blakjak 115 Oct 8 01:37 foo.php
> -rwxr-xr-x 1 blakjak blakjak 6285 Oct 8 01:37 bar.php
>
> My destination:
> $ ls -l /active/path
> -rwxr-x--- 1 blakjak wwwadmin 115 Oct 8 02:06 foo.php
> -rwxr-x--- 1 blakjak wwwadmin 6285 Oct 8 02:06 bar.php
>
> $ touch foo.php
> $ rsync -Curv --exclude='.*' --exclude='*~'
~/working/source/path/
> /active/path
> $ ls -l /active/path
> -rwxr-x--- 1 blakjak blakjak 115 Oct 8 20:05 foo.php
> -rwxr-x--- 1 blakjak wwwadmin 6285 Oct 8 02:06 bar.php
>
> ----
>
> Note that the permissions on the destination files have been left alone,
> but the group has been changed.
>
> The man page indicates that group will only be preserved if you use the
> -g option (or by extension, the -a option), which I have not. There is
> no option to disable the preservation of group. Therefore the default
> behaviour in all cases should be to _not_ preserve group unless the user
> specifies otherwise. I can't understand why rsync is altering the
> destination files in this way.
>
> If you can shed any light on this, I'd love to hear from you.
Is the user doing the rsync root or a member of the wwwadmin
group? It is creating a new file and then chowning it and
you can't set the gid of a file to a group you aren't a
member of.
--
________________________________________________________________
J.W. Schultz Pegasystems Technologies
email address: jw@pegasys.ws
Remember Cernan and Schmitt