HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- cleaning log files
Operating System - Linux
1828390
Members
2960
Online
109977
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2000 04:52 AM
06-26-2000 04:52 AM
cleaning log files
Hello,
I would like to clean up log files during they are open (e.g. the access log of a web server). On HP-UX i can do that by using "cat /dev/null > LOGFILE". After that the LOGFILE is empty. If I do the same on Linux, the content of the file is overwritten with NULL characters and the file size remains the same as before. New entrys to the file are appended after the NULL characters.
Is there a way to clean up log files like on HP-UX?
I know that there is a solution for the apache web server but I need a solution for other software as well.
Thank you
I would like to clean up log files during they are open (e.g. the access log of a web server). On HP-UX i can do that by using "cat /dev/null > LOGFILE". After that the LOGFILE is empty. If I do the same on Linux, the content of the file is overwritten with NULL characters and the file size remains the same as before. New entrys to the file are appended after the NULL characters.
Is there a way to clean up log files like on HP-UX?
I know that there is a solution for the apache web server but I need a solution for other software as well.
Thank you
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2000 05:41 AM
06-26-2000 05:41 AM
Re: cleaning log files
Andreas,
The problem which you are pointing to is that which happens when you truncate a file (in this case a logfile) which has open connections to it.
If you weere to temporaily suspend the application or tell it to restart immediately after truncating the logfile, then size will be reduced. As long as the file remains open, the original length of the file will be preserved, according to the open file handles.
Hope this helps.
The problem which you are pointing to is that which happens when you truncate a file (in this case a logfile) which has open connections to it.
If you weere to temporaily suspend the application or tell it to restart immediately after truncating the logfile, then size will be reduced. As long as the file remains open, the original length of the file will be preserved, according to the open file handles.
Hope this helps.
Sr. Systems Consultant @ ABS Computer Technology, Inc. http://www.abs-comptech.com/aewhale.html & http://www.ancegroup.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2000 05:07 PM
06-26-2000 05:07 PM
Re: cleaning log files
Andreas,
A solution to your problem is to issue the command "> LOGFILE_NAME", this will zero the log file, and start it fresh.
e.g. "> /var/log/messages"
Hope that this helps you.
Regards
Chris
A solution to your problem is to issue the command "> LOGFILE_NAME", this will zero the log file, and start it fresh.
e.g. "> /var/log/messages"
Hope that this helps you.
Regards
Chris
How much truth can money buy?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2000 01:08 AM
09-27-2000 01:08 AM
Re: cleaning log files
Did you already try:
> LOGFILE
With Regards,
Dieter Degrendele
> LOGFILE
With Regards,
Dieter Degrendele
Dieter@Work
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP