Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unison preserve directory time

In the Unison (two way file syncing program) manual, when you set the -times=true preference, only the time stamps of the files are kept unchanged, not the directores:

From the Manual:

times When this flag is set to true, file modification times (but not directory modtimes) are propagated.

I wanted to see if there is any way the directory time could also be preserved during a sync?

like image 568
makhlaghi Avatar asked Oct 19 '22 16:10

makhlaghi


2 Answers

After looking through the Unison manual, it appears that that answer to this question is No.

like image 86
Mike Pierce Avatar answered Oct 22 '22 21:10

Mike Pierce


This open issue says that it's not possible, and non-trivial to implement.

You could unison first, then rsync -r --times --size-only --existing afterwards to sync just the times on paths which already exist.

like image 28
Tom Hale Avatar answered Oct 22 '22 21:10

Tom Hale