Results 1 to 2 of 2
Well, I woke up this morning and my server had crashed because my syslog and daemon log files had grown too large and used up all of the room on ...
- 10-14-2007 #1
Logfiles getting too big
Well, I woke up this morning and my server had crashed because my syslog and daemon log files had grown too large and used up all of the room on the harddrive.
I've wrote a small script to gzip the log contents when it gets too big, but I could've sworn that there was a script doing this task when I first installed the system; in any event, it's not operating now.
Does anyone know of any programs that trim log files? My script is okay, but I'd rather use something that can operate as a daemon.
Thanks
- 10-15-2007 #2Just Joined!
- Join Date
- Oct 2007
- Posts
- 1
Your script isn't a good idea because you might not "restart" the daemon that is writing to that file. The daemon still thinks the file is there (it isn't) and never remakes it (so you wont have any more pretty logfiles). You should be using
to restart the daemon after you have backed up the logfile (if you aren't already).Code:kill -HUP `pidof daemon`
Most use logrotate to do what you are doing via your script. Here's a tutorial I found (via google search logrotate - Google Search) on how to use this program/daemon: The Tao of Mac - HOWTO: Use logrotate


Reply With Quote
