Is there any way to reset or re-zero the Raw Logs to
assess the access to the site (linux/apache server). The client have been using them to see who has accessed the site following a mailing to corporations on a product they're releasing and would like to be able to 'reset' it periodically to make reviewing it a bit easier. Is this possible? Hoping for some input.
Thanks
John
ffeingol
10-15-2002, 10:39 AM
It sounds as if you're talking about the Apache logs. If that's true, you can just "mv" (move) the existing file to a new name and they issue a "graceful" restart to Apache. It will close the renamed log and open a new one.
Frank
apollo
10-15-2002, 10:47 AM
or you could also do the 'bad way'
echo "" > log_file_here
:))) But you lose log file content
ffeingol
10-15-2002, 12:02 PM
Originally posted by apollo
or you could also do the 'bad way'
echo "" > log_file_here
:))) But you lose log file content
And you may end up with a very large empty file ;)
Frank
drhonk
10-15-2002, 12:34 PM
I would find a good logrotate scripts which I think RedHat has one already. You can set it to rotate log every night and only keep the logs for 7 days. That way the script will delete all logs that are older than 7 days. I think this is a better way than deleting content of these logs.
You never know when you will need these old logs .. :)
Cheers,
Thanks alot for your suggestions :). So it can be done. That's great.
John
jstanden
10-16-2002, 12:14 AM
Just a note:
With some server daemons (or versions) when you physically move a file rather than copy and zero it (with echo > [file]) the file handle is lost, and until that daemon is restarted it will not continue logging.
Depending on the code, this can be sometimes be fixed with a simple "touch filename".
I'd recommend a good logrotate script as well, and just bypass the whole hassle of nuking the large logs. :)