[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tail --recursive
From: |
Jim Meyering |
Subject: |
Re: tail --recursive |
Date: |
Thu, 13 Nov 2008 23:12:02 +0100 |
Simon Windows <address@hidden> wrote:
> Jim Meyering wrote:
>> Thanks for the contribution.
>> I haven't looked at it at all yet,
>> but wonder if you've considered using inotify?
>> That seems like that mechanism would be much more appropriate,
>> when tailing many files in an arbitrary hierarchy.
>>
>> There are already a couple of inotify(7)-based versions
>> of tail. I see one that's called inotail.
>
> I hadn't considered inotify, to be honest I wasn't aware of it.
>
>> One of the most important parts of a new-feature suggestion
>> is the justification for it. Why is your feature needed?
>> And can it be made robust? I.e., what if there are more files
>> in the hierarchy than the maximum number of open file descriptors?
>
> I wanted it to monitor the output of a folder of log files and tail -f
> <dir>/* would not give me new files. A good example would be monitoring
> /var/log on a system that uses logrotate. tail -rf /var/log would
> satisfy this.
>
> I haven't put any additional features in to make it robust aside from
> checking return values to prevent a segfault. What would you suggest?
Look at iwatch?
http://iwatch.sourceforge.net/
>From its man page:
USAGE EXAMPLES
% iwatch /tmp
Monitor changes in /tmp directory with default events.
% iwatch -r -e access,create -m address@hidden -x /etc/mail /etc
Monitor only access and create events in /etc directory recur-
sively with /etc/mail as exception and send email notification
to address@hidden
% iwatch -r -c (w;ps -ef)|mail -s '%f was changed' address@hidden /bin
Monitor /bin directory recursively and execute the command.
% iwatch -r -X '.svn' ~/projects
Monitor ~/projects directory recursively, but exclude any .svn
directories inside. This can't be done with a normal '-x' option
since '-x' can only exclude the defined path.
- tail --recursive, Simon Windows, 2008/11/13
- Re: tail --recursive, Matthew Woehlke, 2008/11/13
- Re: tail --recursive, Simon Windows, 2008/11/13
- Re: tail --recursive, Jim Meyering, 2008/11/13
- Re: tail --recursive, Simon Windows, 2008/11/13
- Re: tail --recursive,
Jim Meyering <=
- Re: tail --recursive, Simon Windows, 2008/11/14
- Re: tail --recursive, Jim Meyering, 2008/11/14
- Re: tail --recursive, Simon Windows, 2008/11/14
- Re: tail --recursive, Jim Meyering, 2008/11/14
- Re: tail --recursive, Matthew Woehlke, 2008/11/14
- Re: tail --recursive, Jim Meyering, 2008/11/15
- Re: tail --recursive, Simon Windows, 2008/11/15