Rsync update only timestamp

file-copyrsync

I use the following command to synchronize two folders :

rsync -avhiu --progress --stats folder1/ folder2/

But unfortunately I have a bunch of file which differ only by their time stamps and rsync does the transfer of the whole file only to modify the time …

The man page of rsync says the following :

sending only the differences between the
source files and the existing files in the destination

So I assume I do something in the wrong way. How can I make rsync copy only the time (when it is the only attribute changing of course) ?

Best Answer

The -W option is implied if you use rsync without copying to/from a remote system (i.e. only between two local folders):

-W, --whole-file

With this option rsync’s delta-transfer algorithm is not used and the whole file is sent as-is instead. The transfer may be faster if this option is used when the bandwidth between the source and destination machines is higher than the bandwidth to disk (especially when the "disk" is actually a networked filesystem). This is the default when both the source and destination are specified as local paths, but only if no batch-writing option is in effect.

Try running with --no-whole-file or --no-W:

rsync -avhiu --no-whole-file --progress --stats folder1/ folder2/
Related Question