Does rsync copy if only perm changed?

Wayne Davison wayned at samba.org
Fri Jun 10 18:09:33 GMT 2005


On Thu, Jun 09, 2005 at 04:26:27PM -0700, CompuGenic wrote:
> If only the permissions changed on the source, 
> will rsync unlink the file before modifying it on the destination? 

No.  Rsync just changes the permissions/group/owner of a file if it
differs.

> I do "cp -ar daily.01 daily.00". Then I do "rsync - ar -e "ssh -i keypath" --delete 
> user at remote:/source/path/ /local/path/daily.00/".

You'd be better off getting rid of the cp command and using the
--link-dest=/local/path/dail.01 option to rsync so that it manages all
the hard-linking of files to the older versions.  Rsync only hard-links
files that are exactly the same in all (preserved) attributes, and it
uses the older file as a means to optimize the transfer when the file
differs.  With the current release of rsync, you can even specify
multiple --link-dest=DIR options, which allows a file to be hard-linked
to an older version (if a file reverts to an earlier state).

..wayne..


More information about the rsync mailing list