#3 Do more to maintain directory timestamps
Closed: Fixed 5 years ago Opened 7 years ago by tibbs.

Now that file deletion has been moved to happen after the rsync run, there are two places where directory timestamps might be out of sync with the master:

  • When stale files and directories are deleted. This obviously alters mtime on the containing directory.

  • When files are missing locally but not updated on the server and thus added to the file list, the containing directory is not also added to the list, so rsync doesn't preserve its timestamp.

The solution to the second issue is obvious. The first is less obvious. A "delete and preserve mtime of containing dir" function would be useful. It would be much slower, of course, to touch the containing directory after each deletion, but has the benefit of keeping the timestamp out of sync for less time. I don't think rsync does better.

An optimization to this case is to push the containing dir and timestamp into an array when that directory is first encountered and not after. Then run through that array and fix up the timestamps. This allows mtime to be desynced for a bit longer, but I believe this matches rsync's behavior in this case.


This is actually implemented, and it should be working, but it needs test suite support.

Some tests are implemented by 338ae37.

Metadata Update from @tibbs:
- Issue untagged with: far future
- Issue close_status updated to: Fixed
- Issue status updated to: Closed (was: Open)

5 years ago

Login to comment on this ticket.

Metadata