1

Can I keep updatedb on but prevent it from changing atimes? I want to automatically tar up repos that haven't been accessed (by me, not some daemon) for a certain period of time.

1 Answer 1

4

mlocate's updatedb reads directories with O_NOATIME, so it won't affect atimes when indexing.

I don't know about other versions of updatedb...

3
  • Thanks. This is very helpful. linux.die.net/man/8/tmpwatch says "Note that the periodic updatedb file system scans keep the atime of directories recent." so I guess that's wrong then. May 15, 2015 at 10:24
  • I think I mistakenly blamed updatdb for my recent atimes when recollindex was the culprit -- no O_NOATIME flags in its strace. May 15, 2015 at 10:34
  • Right, it's a shame there's no easy way of determining the cause of atime changes! As far as tmpwatch's manpage is concerned, there may be other implementations of updatedb where directories' atimes are updated, so the warning would be correct there; findutils' implementation of updatedb in particular is just a shell script which doesn't do anything special (as far as I can see) to preserve atimes. May 15, 2015 at 11:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .