I know that by changing something in 'etc/fstab' I can activate atime for every file in the system. But what I need, or rather want, is to activate it for a specific directory, say 'var/www/vhosts/myfiles'. Is it possible? What would I need to add to the fstab file in order to do that? Thanks in advance.
migrated from stackoverflow.com Oct 5 '12 at 23:21
This question came from our site for professional and enthusiast programmers.
Unfortunately you cannot. You only disable atime for specific items, not enable it.
So maybe, if your /var/www is on a separate partition, you can enable atime (in fstab) for everything on this mountpoint, then recursively disable atime for every root folder of this mountpoint minus 'var/www/vhosts/myfiles' using:
the '+A' is the 'disable atime' attribute.
But it can only be a real alternative if there is not too many changes inside your FS directories / files (newly created items won't have the 'disable atime' attribute set.
Sorry for not being able to help more, but I really think it's a system limitation.
Note that on recent kernel versions, you can use the mount option 'relatime' (it is even the default I think), which still updates atime but far less often, so you don't notice the performance impact of it.