From owner-freebsd-questions@FreeBSD.ORG Tue May 13 04:58:44 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF5B137B401 for ; Tue, 13 May 2003 04:58:44 -0700 (PDT) Received: from catflap.home.slightlystrange.org (pc1-cmbg1-4-cust43.cmbg.cable.ntl.com [62.253.133.43]) by mx1.FreeBSD.org (Postfix) with ESMTP id 974A143FA3 for ; Tue, 13 May 2003 04:58:43 -0700 (PDT) (envelope-from dan@slightlystrange.org) Received: from danielby by catflap.home.slightlystrange.org with local (Exim 3.36 #1) id 19FYRh-000LWZ-00 for freebsd-questions@freebsd.org; Tue, 13 May 2003 12:59:49 +0100 Date: Tue, 13 May 2003 12:59:49 +0100 From: Daniel Bye To: freebsd-questions@freebsd.org Message-ID: <20030513115949.GA13162@catflap.home.slightlystrange.org> Mail-Followup-To: freebsd-questions@freebsd.org References: <1052826451.27682.29.camel@horus> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1052826451.27682.29.camel@horus> User-Agent: Mutt/1.4.1i X-Scanner: exiscan *19FYRh-000LWZ-00*ZMY95jsxe76* (SlightlyStrange.org, Using NOD32 http://www.nod32.com) Subject: Re: Trigger on file change X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: dan@slightlystrange.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2003 11:58:45 -0000 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 / \