Introduction
There is no easy way to rotate or clear error_log files that grow to a certain size.
Procedure
This can be either done in a user's cron job with the path to the user's home directory or can be done on the entire data path for users on the server, like /home. You can read more about editing the crontab here:
The following example could be added to the root user's crontab to clear cPanel users' error_log files over 2 MB in size.
This example performs a removal of the error_log files it finds over 2M in size. Please take care if using this example to enter it exactly as shown to prevent unintended file removal. Please consult your System Administrator if you require a different solution.
find /home -path /home/virtfs -prune -false -o -type f -size 2M -name error_log -exec rm -f '{}' \;
Comments
0 comments
Article is closed for comments.