How to empty cPanel Server logs in one stroke?

empty cPanel Server logs in one stroke

Its very easy question really.You can empty cPanel servers logs by using following commands

Login into server as root

root@admin[#]vi logs

echo > /usr/local/apache/logs/error_log
echo > /usr/local/apache/logs/access_log
echo > /usr/local/apache/logs/access_log
echo > /usr/local/apache/logs/error_log
echo > /usr/local/cpanel/logs/access_log
echo > /usr/local/cpanel/logs/error_log
echo > /var/log/exim_mainlog
echo > /var/log/exim_rejectlog
echo > /var/log/maillog
echo > /var/log/messages
echo > /var/log/messages.1
echo > /var/log/maillog.1

:wq!

root@admin[#]chmod 755 logs

root@admin[#]./logs

It will empty all logs present on your server.

 

About Anant 376 Articles
Senior technical writer