files' timestamp handling - bug or design decision?

Eugene Kramer eugene.kramer at gmail.com
Thu Mar 31 05:16:03 GMT 2005


Hello,

A few days ago I posted a question about handling timestamps in rsync
(Q: rsync - preserve timestamps, but not use it to define files to
update), but did not get a single response, so I thought I'd rephrase
it. Also, with a new release of rsync out, may be there is some more
time that knowledgeable people have :-) So here it goes.

I want to be able to do two things together:
-- transfer files from the source to destination only if the files'
contents is changed
-- when the files are transfered, I want to preserve original timestamp

The first item is taken care by --size-only and --checksum
The second - by --times. However, when the two are combined, the
destination gets updated whenever the files in the source are touched.

I have a directory, where some tool creates files - database exports,
for example. I want to check in these exports into a source control,
which is timestamp sensitive and I do not want to create a new version
every time the file is exported. So I have a staging area, where the
data gets exported from the database, and I want to update my source
control work area from the staging, but transfer only files, which
actually changed.

By looking at the switches available in rsync, I assumed that a
combination of --times and --checksum would do what I want, but
apparently, --times not only tells rsync to preserve timestamps on
transfer, but also to consider the files for the transfer if there is
a discrepancy in the mtime of the files.

You help is highly appreciated.

Eugene.


More information about the rsync mailing list