Drillster / drone-volume-cache

Drone plugin for caching to a locally mounted volume
MIT License
109 stars 42 forks source link

Preserve timestamp for rsync? #18

Closed kkimdev closed 6 years ago

kkimdev commented 6 years ago

rsync -t

https://unix.stackexchange.com/questions/61586/how-to-tell-rsync-to-preserve-time-stamp-on-files-when-source-tree-has-a-mounted

This will make caching for timestamp based buildsystem more reliable, e.g., make.

kkimdev commented 6 years ago

nvm it seems like -a already includes -t.

kkimdev commented 6 years ago

OK, the real issue was more nuanced than I thought. Using drone-volume-cache made my Makefile rebuild certain steps unnecessarily. So I thought last modified timestamp for files is re-written. Actually it was opposite, some files' last modified timestamp weren't updated.

For example,

Right after Makefile build:

after rebuilding and restore:

Noticed that generated.h's timestamp went backward. I suspect that what's happening here is that, generated.h's timestamp changed after Makefile build, but the content isn't changed. And when drone-volume-cache plugin caches by rsync, rsync figured out that it didn't need to resync generated.h since the content is the same, so generate.h's timestamp is not updated.

kkimdev commented 6 years ago

OK please hold on let me investigate a bit, sorry for adding contradicting messages.

kkimdev commented 6 years ago

OK, the issue for me was that git clone step does not preserve last modified timestamp, not drone-volume-cache plugin. Since git doesn't store timestamp.