Permissions Problems

Dave Dykstra dwd at
Sat Jan 19 03:04:42 EST 2002

Not true, Tim.  I just tried it, and if the file on the destination side is
newer than on the source, the permissions of the source will not be
propigated to the destination.

No, the answer is easily found if you grep for "update_only" in the rsync
source code.  It is only used in one place to determine rsync's operation,
and that's only after directories have already been dealt with.  If
somebody is interested in writing a patch and testing it, I expect it will
be accepted.

If you work on it, keep in mind that any time a file is modified by rsync
its directory will be modified (because rsync always creates a temporary
file in the directory and renames at the end) so you'd need to go by the
timestamp of the directory before any files are updated.  I think that
should be easy because rsync creates the file list before it does any
updates, but watch out for it.

Oh, wait: what happens if somebody does a chmod on side 'a', and then on
side 'b' creates or renames a file?  In that case, the directory on side
'b' will be newer even though what you want is the permissions of side 'a'.
Remember that changing permissions does not change the modification time,
only the inode change time.  

It still probably doesn't make sense to copy older directory modification
times when the -u flag is used, as is happening now, regardless of permissions.

- Dave Dykstra

On Thu, Jan 17, 2002 at 01:12:48PM -0800, tim.conway at wrote:
> Doug:  you're not doing anything wrong, from your description.  You'll 
> find that if you change the mode on a file on the source that's already 
> identical to its counterpart on the destination, that change will be 
> propogated as well.  Changing mode of a directory has no effect on the 
> modes of its contents, so there was nothing to do to the files in the dir. 
> That two-way sync you're doing is a bit dangerous, in most circumstances. 
> On the surface, it makes sense that the most-recently updated file is the 
> one you want.  In most situations where someone wants that, it's possible 
> to have changes made on both sides, whereby he who saves last wins, and he 
> who saves first gets his changes discarded.  Is that ok in your situation?
> Tim Conway
> tim.conway at
> 303.682.4917
> Philips Semiconductor - Longmont TC
> 1880 Industrial Circle, Suite D
> Longmont, CO 80501
> Available via SameTime Connect within Philips, n9hmg on AIM
> perl -e 'print pack(nnnnnnnnnnnn, 
> 19061,29556,8289,28271,29800,25970,8304,25970,27680,26721,25451,25970), 
> ".\n" '
> "There are some who call me.... Tim?"
> "Doug Summers" <summersd at>
> Sent by: rsync-admin at
> 01/17/2002 12:19 PM
>         To:     rsync at
>         cc:     (bcc: Tim Conway/LMT/SC/PHILIPS)
>         Subject:        Permissions Problems
>         Classification: 
> I'm trying to synch 2 directories and, using the example from the FAQ, my
> commands look like this:
> rsync -auqz directory1 remoteserver:/test
> rsync -auqz remoteserver:/directory1 /test
> If I change a directory's permissions and/or timestamp on the remote 
> server
> the 1st rsync command changes it back to match the source. Files, however
> are unaffected and only get updated if newer. For example:
> (On remote server)
> drwxr-x---   2 root     sys          512 Jan 17 11:16 test/
> (On source server)
> drwxrwxrwx   2 root     other        178 Jan 17 10:36 test/
> After the 1st command is run both directories look like the source server.
> If I were to switch these around it works fine.
> What I am doing wrong???
> Doug

More information about the rsync mailing list