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.


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

| improve this answer | |
  • 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. – PSkocik May 15 '15 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. – PSkocik May 15 '15 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. – Stephen Kitt May 15 '15 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.