Results 1 to 7 of 7
-
10-15-2002, 10:34 AM #1Web Hosting Master
- Join Date
- Feb 2002
- Posts
- 1,298
Can raw logs be reset or re-zero?
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
-
10-15-2002, 10:39 AM #2Web Hosting Master
- Join Date
- Jun 2001
- Location
- Earth
- Posts
- 1,259
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█ Umbra Hosting
█ cPanel | Softaculous | CloudLinux | R1Soft | Ksplice
█ Web Hosting, Reseller Hosting, VPS, Dedicated Servers, Colocation
█ UmbraHosting.com
-
10-15-2002, 10:47 AM #3Web Hosting Master
- Join Date
- Feb 2002
- Posts
- 2,120
or you could also do the 'bad way'
echo "" > log_file_here
)) But you lose log file content
-
10-15-2002, 12:02 PM #4Web Hosting Master
- Join Date
- Jun 2001
- Location
- Earth
- Posts
- 1,259
Originally posted by apollo
or you could also do the 'bad way'
echo "" > log_file_here
)) But you lose log file content
Frank█ Umbra Hosting
█ cPanel | Softaculous | CloudLinux | R1Soft | Ksplice
█ Web Hosting, Reseller Hosting, VPS, Dedicated Servers, Colocation
█ UmbraHosting.com
-
10-15-2002, 12:34 PM #5Web Hosting Master
- Join Date
- May 2001
- Location
- California
- Posts
- 801
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,Roy K.
Pixie Internet Services - http://www.pixiehost.com
Affordable, reliable hosting solution with Instant Activation
-
10-15-2002, 04:52 PM #6Web Hosting Master
- Join Date
- Feb 2002
- Posts
- 1,298
Thanks alot for your suggestions . So it can be done. That's great.
John
-
10-16-2002, 12:14 AM #7Web Hosting Evangelist
- Join Date
- Aug 2001
- Location
- Brea, CA
- Posts
- 541
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.Jeff Standen, Software Architect, Cerb
Cerb - web-based teamwork and workflow automation - https://cerb.ai/