Find the answer to your Linux question:
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 ...
  1. #1
    Linux Newbie SagaciousKJB's Avatar
    Join Date
    Aug 2007
    Location
    Yakima, WA
    Posts
    162

    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

  2. #2
    Just Joined!
    Join Date
    Oct 2007
    Posts
    1
    Quote Originally Posted by SagaciousKJB View Post
    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.
    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
    Code:
    kill -HUP `pidof daemon`
    to restart the daemon after you have backed up the logfile (if you aren't already).

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...