Trigger on file change
Dan Nelson
dnelson at allantgroup.com
Tue May 13 08:03:42 PDT 2003
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 at allantgroup.com
More information about the freebsd-questions
mailing list