D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] monitoring a file

 

On Thursday 29 September 2005 12:53, James Wonnacott wrote:
> I am trying to determine the best way to monitor changes to a directory on
> my server.
> As soon as the diectory contents are updated I want another event to take
> place.
> I have a file alteration monitor called fam (not suprisingly) on my
> mandrake distro but I'm not too sure how to talk to it!!!! (the man file
> is a bit obscure)
>

There's 'inotify' [1][2][3] which is a 2.6 kernel feature designed to do 
exactly this. I've no idea how to use or implement it, but presumably it is 
accessible through a C library.

Here are some links you may find useful: 

* http://www.edoceo.com/creo/inotify/ (this page is somewhat outdated - 
inotify is now part of the standard kernel - no patches needed).
* http://www-128.ibm.com/developerworks/linux/library/l-inotify.html (also 
somewhat outdated - ignore the stuff about kernel patching)
* http://www.kernel.org/pub/linux/kernel/people/rml/inotify/

Regards,
David.

-- 
David Johnson
www.david-web.co.uk - My Personal Website
www.ethereye.org.uk - EtherEye Network Host Checker
www.penguincomputing.co.uk - Need a Web Developer?

--
The Mailing List for the Devon & Cornwall LUG
Mail majordomo@xxxxxxxxxxxxx with "unsubscribe list" in the
message body to unsubscribe. FAQ: www.dcglug.org.uk/linux_adm/list-faq.html