[RC5-PROXYPER] Trimming log-files...

David Kelly dkelly at hiwaay.net
Thu Dec 4 18:13:11 EST 1997

Dirk Kuypers writes:
> thanks for the info. The problem seems to be that ls -l and quota give
> different results now about the file space I use;-). ls insists about
> the file being now about 14 MB, while quota has dropped those 13 MB.
> Now I have again some time till I have to trim the files again.

Now wait one second, just what log file are we talking about? Are you 
trying to rotate a file generated by redirecting the proxy's stdout to 
a file? Or are you attempting to rotate the proxy's logfile?

The FreeBSD proxyper automatically rotates the log at 0000 GMT. A few 
minutes past I use cron to gzip that log and move to another directory.

But what you seem to be describing is a case where you are attempting 
to rotate, pluck off the tail for saving, and delete the rest. If you 
attempt to do that to a file which a process has open, you will not 
release the disk space until the file is closed. Under FreeBSD, "fstat" 
will show you the processes that have a file open. SGI Irix uses 
"fuser", and "lsof" is a widely available utility to do the same.

An old Unix programming trick for temporary files that makes sure its 
cleaned up its mess on exit without any special signal() handlers was 
to create/open the temp file, then unlink() it and use it to your 
heart's delight. While you are using the file it has no name as that 
has been unlinked. When the process exits or closes the file, the 
kernel cleans up and the file is gone.

David Kelly N4HHE, dkelly at nospam.hiwaay.net
The human mind ordinarily operates at only ten percent of its
capacity -- the rest is overhead for the operating system.

To unsubcribe, send 'unsubscribe rc5-proxyper' to majordomo at llamas.net
rc5-proxyper-digest subscribers replace rc5-proxyper with rc5-proxyper-digest

More information about the proxyper mailing list