Skip to main content

Delete Large Log Files - Operation Not Permitted

Comments

5 comments

  • cPanelLauren
    Hi @PCZero! cPanel has the cPanel Log Rotation (cpanellogd) feature which would do this for you cPanel Log Rotation Configuration - Version 76 Documentation - cPanel Documentation You can set the log rotation size threshold for these as well at WHM>>Server Configuration>>Tweak Settings Using these methods would be the advisable way to automatically remove cPanel specific log data. If you must remove the data on your own you'd need to modify the attributes of the log file as they're set to append only though I really wouldn't advise doing this lsattr /usr/local/cpanel/logs/error_log -----a-------e-- /usr/local/cpanel/logs/error_log
    To modify the file attributes you would use chattr and do something like: chattr -a /usr/local/cpanel/logs/error_log
    Then to actually clear the log file I wouldn't use rm I would do something like the following: cat /dev/null > error_log
    Thanks!
    0
  • PCZero
    OK I go to the tweak settings and see nothing under the logs tab about limiting, deleting, or controlling the error_log file.
    0
  • Infopro
    error_log spamd_error_log tailwatchd_log

    You'll note all of these files are listed here: 55437
    0
  • cPanelLauren
    Hi @PCZero It's there under Stats and Logs "Log rotation size threshold" I usually use the search on the right-hand side of the Tweak Settings box to narrow down what I'm looking for.
    0
  • PCZero
    Thank you Lauren
    0

Please sign in to leave a comment.