🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.admin
Article #4070

Re: tail -f and log file rotation

#4070
From: Paul Sack
Date: Fri, 02 Mar 2001 06:00
20 lines
2301 bytes
In article <t9thrboar8bh8e@corp.supernews.com>, Vince wrote:
>I suppose I'm not the only one to have the following problem:
>
>I use "tail -f" to get the new entries in the syslog file. But when the file
>is renamed  (because it's too big or too old), tail is stuck on the renamed
>file, which is not appended anymore.
>I've heard about "tailf" (linux) or the option "tail -fname", but there is
>nothing like that on Solaris, HP-UX or AIX.

Another thing you can do is tell logrotate[0] to copy the log file to its new
place, then truncate the log file. i.e. cp messages to messages.1 and truncate
messages. Then everything will work.

There are opinions on whether or not this is a good thing. You *can* lose a few
messages between when the copy occurs and the file is truncated.

[0] I assume this is what you are using.

-- 
Schizophrenia beats being alone.
Technical Details
Message-ID: <c2cn79.ha.ln@jefe>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!europa.netcrusader.net!208.184.7.66!newsfeed.skycache.com!Cidera!cyclone.tampabay.rr.com!cyclone.austin.rr.com!cyclone2.austin.rr.com!typhoon.austin.rr.com.POSTED!not-for-mail
References: <t9thrboar8bh8e@corp.supernews.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11035d,28d4954342c36ebf
X-Google-Attributes: gid11035d,public
X-Google-Thread: 1020c6,28d4954342c36ebf
X-Google-Attributes: gid1020c6,public
X-Google-Thread: 115614,28d4954342c36ebf
X-Google-Attributes: gid115614,public
X-Google-Thread: fc89c,28d4954342c36ebf
X-Google-Attributes: gidfc89c,public
X-Google-Thread: 110f2c,28d4954342c36ebf
X-Google-Attributes: gid110f2c,public
X-Google-ArrivalTime: 2001-03-01 22:18:08 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!europa.netcrusader.net!208.184.7.66!newsfeed.skycache.com!Cidera!cyclone.tampabay.rr.com!cyclone.austin.rr.com!cyclone2.austin.rr.com!typhoon.austin.rr.com.POSTED!not-for-mail
From: paul-sackun@jefe.eyep.net (Paul Sack)
Newsgroups: comp.unix.admin,comp.unix.aix,comp.unix.programmer,comp.unix.solaris,fr.comp.os.unix
Subject: Re: tail -f and log file rotation
References: <t9thrboar8bh8e@corp.supernews.com>
Organization: we don't need no steenking organization
Reply-To: paul-sackun@jefe.eyep.net
User-Agent: slrn/0.9.6.3 (Linux)
Message-ID: <c2cn79.ha.ln@jefe>
Lines: 20
Date: Fri, 02 Mar 2001 06:00:18 GMT
NNTP-Posting-Host: 24.93.45.199
X-Complaints-To: abuse@rr.com
X-Trace: typhoon.austin.rr.com 983512818 24.93.45.199 (Fri, 02 Mar 2001 00:00:18 CST)
NNTP-Posting-Date: Fri, 02 Mar 2001 00:00:18 CST