Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 May 2003 12:59:49 +0100
From:      Daniel Bye <dan@slightlystrange.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: Trigger on file change
Message-ID:  <20030513115949.GA13162@catflap.home.slightlystrange.org>
In-Reply-To: <1052826451.27682.29.camel@horus>
References:  <1052826451.27682.29.camel@horus>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, May 13, 2003 at 01:47:31PM +0200, Guy Van Sanden wrote:
> I need to have a script run everytime a file changes.
> The file only changes once every month (tops), but the script needs to
> be run rather fast after the change (5-10 minutes)
> 
> I thought of leaving the script looping, making a checksum / date check
> every time and sleeping the rest, but it seems like a lot of overhead
> (disk access).
> 
> Does anyone know of a utility that can do this, possibly one that can
> monitor filehandlers in the kernel?

No, but another idea comes to mind - what sort of file is it?  If it is a
text file, and it is changed by a human operator, could you roll a wrapper
for their editor that will perform the necessary actions upon save and exit?
This way, no need for an additional external script at all.  Even if it is
copied from the network, something similar would be possible, I'm sure.

Just a thought.

Dan

-- 
Daniel Bye

PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc
PGP Key fingerprint: 3D73 AF47 D448 C5CA 88B4 0DCF 849C 1C33 3C48 2CDC
                                                                     _
                                              ASCII ribbon campaign ( )
                                         - against HTML, vCards and  X
                                - proprietary attachments in e-mail / \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030513115949.GA13162>