How to make rsync preserve timestamps of unchanged files
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 no开发者_开发技巧t 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.
The -c
option seems to do what I want. The performance penalty is not an issue in my case.
Have you tried the -t and -E flags?
EDIT: Uh... or is the timestamp of the source files changed every time you regenerate the website, even if the files haven't changed?
精彩评论