Bug 9770 - Preserving ownership and permissions does not work
Summary: Preserving ownership and permissions does not work
Status: RESOLVED WORKSFORME
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.9
Hardware: x64 Linux
: P5 critical (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-06 20:18 UTC by Ivan
Modified: 2013-05-26 23:53 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan 2013-04-06 20:18:19 UTC
Options -a, -p, -o , -g does not work.

Rsync is still changing ownership and perissions (running as superuser).

Source dir contents:
drwxrwsr-x  8 ivan media    8 Дек  7 02:00 audio
drwxrwsr-x 15 root media   15 Мар 20 16:34 backup
drwxrwxr-x  3 ivan media    3 Мар 19 15:26 dibujos
drwxrwsr-x  6 ivan media    6 Мар 16 10:07 dist
drwxrwsr-x  9 ivan ivan    10 Авг  5  2012 gente
drwxrwsr-x 12 ivan media   12 Фев 26 11:34 textos

Command: 
rsync -a Source/* Dest/

Destination dir result:
drwxrwsr-x  8 ivan media 4,0K Дек  7 02:00 audio
drwx------  2 root root  4,0K Апр  7 00:14 backup
drwx------  2 root root  4,0K Апр  7 00:14 dibujos
drwx------  2 root root  4,0K Апр  7 00:14 dist
drwx------  2 root root  4,0K Апр  7 00:14 gente
drwx------  2 root root  4,0K Апр  7 00:14 textos

I would be grateful for you response.
Comment 1 Kevin Korb 2013-04-06 22:56:16 UTC
Try: rsync -vai Source/ Dest/

Also, verify that you are running rsync as root and that the target filesystem supports such features.
Comment 2 Kevin Korb 2013-04-07 03:43:11 UTC
Oh, also, now that I look at this again (it was still open in my browser when I got home)....

Are you looking at this while it is running or aborting rsync before it finishes?  Rsync creates directories with default ownership and 700 permissions to make sure it doesn't get a permission denied error when it tries to add files.  Once it is done with a directory it goes back and sets the ownership, group, permissions, and timestamps.
Comment 3 Ivan 2013-04-07 07:30:06 UTC
(In reply to comment #2)
> Oh, also, now that I look at this again (it was still open in my browser when I
> got home)....
> 
> Are you looking at this while it is running or aborting rsync before it
> finishes?  Rsync creates directories with default ownership and 700 permissions
> to make sure it doesn't get a permission denied error when it tries to add
> files.  Once it is done with a directory it goes back and sets the ownership,
> group, permissions, and timestamps.

OK, I will check this.
Comment 4 Wayne Davison 2013-05-26 23:53:32 UTC
Yeah, that looks like the early dir creations for an incremental transfer that would get fixed up later in the transfer when the actual directory info is sent.