Clearing Error Log Issue
Hello,
I have a question. When trying to empty the cPanel error logs via command:
It returns an error message "bash: /usr/local/cpanel/logs/error_log: Operation not permitted." Is this a directory/file permission(s) issue? I am using terminal access as well within WHM. Any help would be appreciated.
echo > /usr/local/cpanel/logs/error_logIt returns an error message "bash: /usr/local/cpanel/logs/error_log: Operation not permitted." Is this a directory/file permission(s) issue? I am using terminal access as well within WHM. Any help would be appreciated.
-
You must be logged in as root if you want to delete or clear that log (or any cPanel logs). 0 -
You must be logged in as root if you want to delete or clear that log (or any cPanel logs).
It still does not work, even logged in as root.0 -
It still does not work, even logged in as root.
if you zero the log file you must restart the service, i.e. (if it's cPanel's log file) service cpanel restart0 -
This won't work even as the root user because the cPanel error logs are set to append only: [root@server logs]# lsattr /usr/local/cpanel/logs/error_log -----a-------e-- /usr/local/cpanel/logs/error_log
This is not the best way to clear cPanel log files, I would suggest you do the following to maintain the cPanel log files: 1. Go to WHM>>Service Configuration>>cPanel Log Rotation Configuration -> Select all logs you'd like to be rotated (in most cases this should be every log file listed) 2. Go to WHM>>Service Configuration>>Tweak Settings -> Log rotation size threshold -> Select the size which you'd like for the cPanel related log files to be rotated This will ensure that every time cPanellogd runs it will check the size of these log files to ensure they do not exceed the threshold, if/when they do they'll be rotated out to/usr/local/cpanel/logs/archive/
and compressed0
Please sign in to leave a comment.
Comments
4 comments