Prune "Connection reset" spam from the server.log

Discussion in 'Bukkit Tools' started by palisade, Apr 6, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    palisade

    If you're as annoyed as I am by the constant stream of "Connection reset" messages showing up in your logs, making them difficult to read, then you'll be interested in this Linux script. Toss this in a file called prunelog and chmod +x it:

    Code:
    #!/bin/sh
    sed -i '/Connection reset/d' server.log
    When you run this, it will change the file in-place (-i option), finding instances of lines containing the string "Connection reset" and removing them. If you want to place the script somewhere like your bin path instead of your mc path, change server.log in the script to point to where your server.log is located.

    Or, you could just type this sed command out yourself if you don't mind just typing it, it's not long.

    Hope this helps.
     
    Jacek likes this.
  2. Offline

    zoski

    Thank you ! This small script serves me well !

    I use crontab to make the clean each hour :
    "crontab -e" then :
    Code:
    0 * * * * ./prunelog.sh
    
    Edit :
    Don't do that 'cause it will freeze your server.log and it will not be updated... Your server seems to be off to use prunelog.sh
     
Thread Status:
Not open for further replies.

Share This Page