Solved

Rotating/Trimming Log Files

Posted on 1998-04-29
2
248 Views
Last Modified: 2006-11-17
I want to make a copy of all log files on my servers and then tar and compress them to tape. After this, I would like to trim the log files down. Question--while running a command to trim the files, how do you account for the possibility that the log file(s) could still be written to (since these log files could have open processes). Isn't it possible that even in this fraction of a second that the trim command is taking place and zeroing out the log file, your system could be trying to log new entries that may go into the bit bucket. In a secure system, this could be critical information lost.
0
Comment
Question by:WVBoy
2 Comments
 
LVL 2

Accepted Solution

by:
jaked earned 200 total points
ID: 2006549
The way this is usually dealt with is to rename the log file (the server still has an open filehandle to it after the rename, so it can keep writing to it), and then SIGHUP or otherwise restart the server so that it reopens its log file (since you've renamed the old one, a new one is started).

0
 

Author Comment

by:WVBoy
ID: 2006550

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now