If you want to clear error_log to a particular size of file then you can either done this with user’s cron job or you can done this for entire server with /home.
Here is the command which can be use to add in root’s crontab which can be use to clear error_log files whose size over 2M.
Here is the command which can be use to add in root’s crontab which can be use to clear error_log files whose size over 2M.
Code:
find /home -path /home/virtfs -prune -false -o -type f -size 2M -name error_log -exec rm -f '{}' \;