Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 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.

like image 287
Petri Lehtinen Avatar asked Mar 23 '11 18:03

Petri Lehtinen


1 Answers

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

like image 166
Petri Lehtinen Avatar answered Oct 20 '22 18:10

Petri Lehtinen