Bug 7668 - Add --omit-link-times option, same purpose as --omit-dir-times
Summary: Add --omit-link-times option, same purpose as --omit-dir-times
Status: RESOLVED WORKSFORME
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.1.0
Hardware: All FreeBSD
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-07 07:55 UTC by Steve Polyack
Modified: 2011-09-28 20:17 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 Steve Polyack 2010-09-07 07:55:33 UTC
When using rsnyc, files are always recreated (as the user performing the rsync) on the destination when the source file has a later mtime, regardless of changes.  Symlinks however, are NOT recreated when the mtime differs; instead, the mtime is simply adjusted on the destination.  This is problematic because a user who does not own a symlink can not adjust the mtime of that symlink to a time that isn't time(NULL) (now) - see utimes(2).  Thus rsync fails with "failed to set times on...".  The rest of the rsync completes, but scripts utilizing rsync may rely on the return codes.

This is likely the same reason that the --omit-dir-times option exists: it is not trivial (or necessary) to recreate a directory to update the mtime.  I have a patch which adds the --omit-symlink-times option to rsync, I will submit it if anyone is interested in committing it.
Comment 1 Carlos Carvalho 2010-09-07 09:25:11 UTC
You mean this?

author	Wayne Davison <wayned@samba.org>	

	 Thu, 26 Aug 2010 15:50:05 +0000 (08:50 -0700)

committer	Wayne Davison <wayned@samba.org>	

	 Thu, 26 Aug 2010 18:12:58 +0000 (11:12 -0700)

commit	2624e005e2c2407c8e108230e6615d2aaba42617

tree	aefd03f05797d1b2dda9d2e27e1e64d92bdb79d6	tree

parent	c9bf436e5b80ad7d001773e3d750149c11f39411	commit | diff


Add --omit-link-times and use CAN_SET_SYMLINK_TIMES less.
Comment 2 Steve Polyack 2010-09-07 09:52:47 UTC
Yes, that is precisely the feature.  When I first posted to the rsync mailing list about it on 08/06/2010, no one had stated that it was already being worked on or even planned.
Comment 3 Wayne Davison 2010-09-07 18:48:10 UTC
I had meant to reply to your on-list email on this subject, but apparently forgot.  I had been working on another symlink bug relating to time when your email prompted me to add the option you suggested (with a name more in keeping with rsync's other symlink-related options).

Thanks for the suggestion!
Comment 4 Steve Polyack 2011-09-28 17:30:26 UTC
This ticket from 2010 describing the --omit-link-times seems to have been lost.  The commit and change that Carlos lists in Comment 1 does not seem to be present in rsync-3.0.9 despite it being released a few days ago.

Has this change been reverted for some reason?  The option would be quite useful.
Comment 5 Wayne Davison 2011-09-28 20:17:09 UTC
New options are coming in 3.1.0.