How to make rsync preserve timestamps of unchanged files

filersynctimestamp

I use a static website generator that generates all the files in the website on each run. After generating the files, I use rsync to copy the content in place.

To allow better caching, I'd like rsync to not modify the timestamp of those files in the destination that have not changed. Is it possible?

EDIT: To make it clear, timestamps of all the source files are always newer than the timestamps of the destination files.

Best Answer

The -c option seems to do what I want. The performance penalty is not an issue in my case.

Related Topic