[sclug] NFS logging

Andy Arbon sclug at andrewarbon.co.uk
Sat Oct 25 09:05:41 UTC 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I'm writing a script to run on my NFS server that keeps a log of which
files have been accessed from a particular export. I'm running into a
problem and I was wondering if anyone knows a solution.

I've been recording which files are being accessed using lsof to look
for open files in the directory which is exported. The problem is that
nfsd only seems to open the file the first time it is accessed, and
subsequent accesses to the same file don't show up in the lsof output.

I presume this is some kind of caching on the part of the nfsd to
improve performace, but in this case it's a little annoying ;)

Does anyone know either:
1) How to prevent this caching from happening for a given export (this
server is under a low load and no caching won't cause a problem).
2) A better way of logging all files accessed in a given export.

(For the curious: The script is to log which music I am listening to
from my media collection so that I can have another program build me a
playlist of what it thinks I'm hooked on at the moment. Should be
interesting writing a good scoring algorithm to balance number of
listens against frequency/how recent they are etc.. (Why yes, it IS exam
revision time, how did you guess? ;))

Cheers,

Andy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+1MOlX3TTUvZURBERApULAKCNBD+sxuSQ8otZ0fFFZOh7g+1JWACdHZ+j
imR5CRoVwRulJPMvz8Nl1pQ=
=ZzI4
-----END PGP SIGNATURE-----




More information about the Sclug mailing list