[Yanel-dev] tail -f on Mac OS X

Mehmet Birgi mehmet.birgi at wyona.com
Thu Apr 29 14:16:09 CEST 2010


Hi all

For some time now I had the problem that when tailing the Yanel log file (on
Mac OS X Snow Leopard) with "tail -f Yanel/logs/log4j-cnode1.log", after a
while the tail would stop, and new log entries would not get printed on the
screen anymore. The only thing to do was to stop the tail with Ctrl-C, and
restart it. I finally found out the reason: although the log file's name did
not change due to log file rotation, on the mac, its inode number would
change (which apparently may not happen on other filesystems). So, the fix
is really simple: use option -F instead of -f. The manpage for tail says:

"The -F option implies the -f option, but tail will also check to see if the
file being followed has been renamed or rotated.  The file is closed and
reopened when tail detects that the filename being read from has a new inode
number."

It's been working for several hours now, so I thought I would share this
information.

Happy coding,

Memo


-- =

Mehmet Birgi
www.wyona.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wyona.org/pipermail/yanel-development/attachments/2010042=
9/87f4437a/attachment.htm


More information about the Yanel-development mailing list