Simon Windows <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] -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 [EMAIL PROTECTED] % iwatch -r -c (w;ps -ef)|mail -s '%f was changed' [EMAIL PROTECTED] /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. _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
