LogCleanup script to keep your server clean every week

There are 5 replies in this Thread which was already clicked 2,048 times. The last Post () by baxter.

    • Official Post

    This is the work of YouKnowWho (R.I.P), all credit to him


    hello to all i made again a small contribution to this great forum
    i hope that a few of you can use this script.
    I made this script for me, because i run my server from a compact flash
    this means that if you have to much logs, the pace can run full.
    this leads to errors.
    and if the log is getting to big you can't see what your looking for anymore.


    its verry easy to use and easy to install
    put the script in the directory where you have your scripts.
    chmod the file 755
    set crontab -e
    01 04 * * 1 /where ever your script is/LogCleanup.sh
    this means the script will remove all the log files
    ones a week on monday at 4:01 AM


    you have to name the files /directory's yourself and you can replace the echo text as you wish to have it.


    my server restarts CCcam in debug if it has crasht and writes a debug file
    in /var/cccamlog
    and i have a configupdate that runs ones a night and writes a log when it has add a new peer.
    and a check script that checks the CCcam every 5 min if it is still running
    and it writes a log to
    this way i can check if the CCcam has done his work ore has some problems.


    but as i said it takes space on the HDD and that is what should be clean.



  • Hi I am a new baby in this ,I am trying to edit crontab to clean logfiles everyday ,my prolem is how to comd 755 and how to save when edit in crontab,I am pressing ctrl + o to save and ctrl+x to exit but when I go back to see the I find that the file is not edit.Please help me thankse444eeec10d0a5f51c.jpg

  • master G

    Added the Label Article

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!