SCIENTIFIC-LINUX-USERS Archives

November 2007

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stephen John Smoogen <[log in to unmask]>
Reply To:
Stephen John Smoogen <[log in to unmask]>
Date:
Tue, 6 Nov 2007 06:40:26 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (47 lines)
On 11/6/07, Johan Mares <[log in to unmask]> wrote:
> I have a SL5.0 installation and I want to monitor a directory for new
> files (FTP), when a file is created a script should be executed to do
> something with the contents of the file and the remove the file.
> When I do a locate on inotify and dnotify they are both found. dnotify
> is found in directories of gamin and kernel. When I try to execute
> dnotify I get a command not found error, the same with inotify. When I
> try the examples at http://www.linuxjournal.com/print/8478,
> http://edoceo.com/creo/inotify/,
> http://www-128.ibm.com/developerworks/linux/library/l-inotify.html, ...
> all I get is errors and not founds.
>

inotify and dnotify are kernel items. You have to write code to talk
to them and interface with it. The code you see in gamin is where it
talks to dnotify and gets an answer.

inotify is usually used by the audit system to do certain things...
not sure if you want that as I think it checks existing inodes for
changes.

dnotify is probably what you want. I think the d-bus interfaces with
that. You would need to see about making a dbus interface
program/script and then using it.

> How can I check if inotify is (correctly) installed and available ?
> Where can I find some good examples to use on SL5.0 ?
> Or is there an alternative in order to raise an event every time a file
> is created in a specified directory ?
> I also asked this question in some newsgroups, the only answer I got was
> to hack my ftpdeamon (vsftpd). (I am webdeveloper (PHP, javascript,
> Ajax, ...) and install LAMPs on SL5.0, but that is it, for now anyway).
>
> Thanx,
>
> Johan
> --
>
> VLIZ
>


-- 
Stephen J Smoogen. -- CSIRT/Linux System Administrator
How far that little candle throws his beams! So shines a good deed
in a naughty world. = Shakespeare. "The Merchant of Venice"

ATOM RSS1 RSS2