[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tailing files that match a certain pattern
From: |
Jim Meyering |
Subject: |
Re: tailing files that match a certain pattern |
Date: |
Thu, 06 Aug 2009 23:39:57 +0200 |
Edward Peschko wrote:
> All,
>
> I was wondering how easy would it be to
> alter tail so that it looks for new files that
> match a certain pattern every few seconds
> to tail?
>
> I have an application where several temp
> files are created, and I don't know what
> they are in advance, eg:
>
> /tmp/newlog.$$
>
> would create /tmp/newlog.2432, etc.
>
> which then could be tailed by
>
> tail -f /tmp/newlog --pat
>
> would tail all files that started with
> /tmp/newlog..
>
> Again, how easy would this be to
> implement, or is it already implemented?
>
> Thanks much,
Applications to look at:
inotifywatch
inotifywait
This is a perl module:
Linux::Inotify2
Or write some C code using inotify(7).