12-17-04 12:44 AM
On 14 Dec 2004 11:14:19 -0500, Roy Smith
<roy@panix.com> wrote:
> I've got a program which write a log to foo.log, and I want to watch
> the contents of that file; tail -f would work fine, but for one
> hitch. Each time the program restarts, it closes the log file, moves
> the old log to foo.log.bak, and starts a new foo.log.
>
> I know some tails have a -F which does exactly that, but I'm on
> solaris, and the solaris tail doesn't support -F. Is there a simple
> way to fake this out on solaris?
Use a crontab to check the size, mtime, and/or inode number of foo.log;
have it restart your script if the inode changes or the size decreases.
--
cowsay -b "Prepare to be assimoolated! "
[ Post a follow-up to this message ]
|