[RC5-PROXYPER] Automatic cycling of proxy logs

David Kelly dkelly at hiwaay.net
Tue Dec 23 20:21:49 EST 1997


> I have been manually editing the proxy ini file to change the file name
> of the log file and restarting the proxy so that the proxy stats program
> works properly. Is there a way to have the proxy automatically put the
> log data in the new log file each day?

Wouldn't it be easier to stop the proxy, rename the old log file and 
restart?

The FreeBSD personal proxy already rotates the log at 00:00GMT. Don't 
remember seeing it documented but I use simply the word "log" in my 
.ini and get "log122497.log". Was disappointed to see .log appended to 
the file name. Was surprised to see the date.

"kill -HUP" forces the equiv of the client's -update? Or does it rotate 
logs too? We had this discussion earlier when someone was capturing 
stdout for further processed and observed his stdout file didn't rotate 
too.

For entertainment I'm capturing my rc5proxy and rc564 stdouts like this:

% ./rc564 |& ./logit &

Where logit is:

#!/bin/sh
while read line
do
	echo $line >> stdout
done

This causes the "stdout" file to be opened and appended for each line of
stdout from the program. Then the file "stdout" is closed while waiting
for the next line. While "stdout" is closed its easy to rotate or
truncate.

I posted a fancier version earlier which caught the -HUP signal, used 
date to compose a new filename, and initialize the new log file with a 
message "new log file created ...." header.


--
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



More information about the proxyper mailing list