Find the answer to your Linux question:
Results 1 to 4 of 4

Thread: Clean logs

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Clean logs

    Hello all,
    So I just found out on one of my servers log rotate is not on...

    How did I find out... lol 100% full / & /var.

    So here is my question, isn't there a way to clean out entries past a certain amount of days? I'd like to shrink it up and then I will turn log rotate on

    I need this asap! Please help if you know how before I just blow the entire log away.


  2. #2
    Linux Newbie
    Join Date
    Feb 2008
    Bangalore, India
    You need to create a small script which will find 1 or more days before logs and zip them.
    you can also add one more shell check which will delete very old logs.

    hint :
    - Use find -mtime option to find 1 or more days old files.
    - Put script in cron and run as per your need.

    If you need script let me know
    Registered Linux User: #476440

  3. #3
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    North Carolina
    have you checked /etc/logrotate.conf or /etc/logrotate.d/?

    logrotate should be able to handle this.

  4. $spacer_open
  5. #4
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Quote Originally Posted by AboveNBeyond
    isn't there a way to clean out entries past a certain amount of days?
    Just let logrotate do its job. There is likely no need to make this into two distinct operations.

Posting Permissions

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