rsync -a --update resets status of newer target directories

Arvid Requate requate at univention.de
Wed Jan 15 09:45:06 MST 2014


Hi,

this is a question regarding the behavior of the --update option for the 
recursive replication of directories. rsync 3.0.7-2 shows the following 
behavior on a Debian squeeze system (ext4):

After running the following commands the adjusted ownership of the 
subdirectory /tmp/dst/sub below the target directory is overwritten and its 
newer modification time is reset to that of the older corresponding source 
directory:

####################
mkdir -p /tmp/src/sub
rsync -auAX   /tmp/src/   /tmp/dst

# now adjust target and update it's mtime
chown nobody /tmp/dst/sub
touch /tmp/dst/sub

# mtime and ownership gets reset to root during next rsync:
rsync -auAX   /tmp/src/   /tmp/dst
####################

This cought me by surprise, as I expected the --update option to cause rsync 
to consider the modification timestamp of the target subdir as newer and skip 
it. This works for files, but doesn't seem to apply to directories.

Is this behavior intended? If so, is there a combination of options or a  
workaround to avoid changing the status of the target subdirectory (while 
still synchronizing its content)?


Cheers,
Arvid

-- 
Arvid Requate
Open Source Software Engineer
Univention GmbH


More information about the rsync mailing list