One of cPanel-based servers (cPanel/WHM 18.104.22.168) I administer has thrown a tantrum tonight. A cPanel log rotator has stuck (in fact, multiple instances were running at the same time) and the end result was very not pretty. The server was extremely sluggish and half of the services were restarting several times an hour.
Upon investigation, it turned out that the Apache log directory
/usr/local/apache/domlogsis filled up with useless junk files like the ones on the picture above. The files are in this naming format:
and the amount of them was so great that running rm resulted in error:
rm -rf bytes-log* /bin/rm: Argument list too long.
which is a result of linux kernel not being able to fit all the file names rm needs to delete into the 128Kb exec() environment buffer.
Well, there is a workaround for that – use output of the find command to feed rm the file names as arguments:
find . -name '*bytes_log*' | xargs rm find . -name 'ftpxferlog*' | xargs rm
*bytes_log* should take care of all domains hosted on this server.
It would not hurt to run cPanel upgrade script /scripts/upcp after cleaning the server to see if there is a new stable version out there.
Happy server cleaning!