rsync to sync my files between my home laptop and my office desktop, with the
-Cauvb --delete options.
Recently, on my laptop, I encrypted my home directory with
ecryptfs, which lives on an
ext4 partition, while in the office I use plain
ext4. The problem is that each time my ecryptfs home gets mounted, the access time of all my directories is changed to the time of the mount operation. This messes up my synchronization with
rsync, because it believes that it needs to synchronize all the directories.
(Note: this holds only for the directories and all the subdirectories, but not to the files in them – apparently, the -u option looks for the modification time when it comes to files, but the access time for directories? All this is not clear from the
So I get a lot of output (my directory tree is rather large and complex), and I cannot see what files actually get synchronized. This is a trouble for me, since because of the
--delete option, I want to see which files get deleted and which ones get overwritten. (Actually, I always run a
--dry-run before the actual synchronization, but this is useless when the output contains my full directory tree.)
I think that the problem could be solved in two ways:
- Either the directory access times should not be modified when my
rsyncshould be instructed to take the modification time for directories, as it apparently does for files.
I couldn’t find out how to achieve either. I would prefer the 1st solution as more logical, since from the user point of view, the directories are not accessed just because the
ecryptfs is mounted.