Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 May 2003 10:03:40 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Guy Van Sanden <n.b@myrealbox.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Trigger on file change
Message-ID:  <20030513150340.GA25807@dan.emsphone.com>
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
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



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