HP3000-L Archives

May 2001, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Mark Bixby <[log in to unmask]>
Reply To:
Mark Bixby <[log in to unmask]>
Date:
Tue, 8 May 2001 13:32:39 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (46 lines)
Hi HP3000-L,

Patrick Thrapp wrote:
>
> Is there a way to empty these log files?  Mine go back quite a few months
> and are quite big.  Can one 'PURGE' these files and expect the
> deamon/listener to rebuild them?  Is there a POSIX way to empty them?  Can
> one 'FCOPY' $NULL into them?
>
> examples
>
> /usr/local/samba/var/log.smb
> /usr/local/apache/logs/@

Apache has a rotatelogs utility that will automatically create a new logfile
after some fixed time interval:

        http://httpd.apache.org/docs/programs/rotatelogs.html

MPE :PURGE should complain about log files being in use.  But if you do a POSIX
rm, the log file will be purged, but what happens next is probably not what you
expect.  The log file doesn't REALLY get purged until the last accessor has
closed it, and so the network server will continue to write entries into the
now "hidden" log file, consuming additional disk space.  Once you terminate the
network server that is writing to the log file, the file will finally be
removed from disk.

So it's cleaner to clean up your log files when the relevant network server
isn't running.

Many POSIX network servers however will allow you to do something like this
while the server is still running:

mv logfile logfile.old   (rename the active logfile)
kill -HUP nnn (send the HUP signal to pid nnn to cause a server restart)
optionally process the now closed logfile.old
rm logfile.old (purge when done)

Apache works this way.  I don't know about Samba & JServ.
--
[log in to unmask]
Remainder of .sig suppressed to conserve scarce California electrons...

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2