From owner-freebsd-questions@FreeBSD.ORG Tue May 13 08:03:41 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 B305E37B401 for ; Tue, 13 May 2003 08:03:41 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 094F643F3F for ; Tue, 13 May 2003 08:03:41 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.9/8.12.9) id h4DF3epx090453; Tue, 13 May 2003 10:03:40 -0500 (CDT) (envelope-from dan) Date: Tue, 13 May 2003 10:03:40 -0500 From: Dan Nelson To: Guy Van Sanden Message-ID: <20030513150340.GA25807@dan.emsphone.com> 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> X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.4i cc: freebsd-questions@freebsd.org Subject: Re: Trigger on file change X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 May 2003 15:03:42 -0000 In the last episode (May 13), Guy Van Sanden said: > 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? Try the wait_on port; it registers a kevent for each filename or directory listed on the commandline, then waits for something to happen. -- Dan Nelson dnelson@allantgroup.com