The following document shall outline the steps to be followed to reduce the size of or clear log files that are not managed on one’s server using the WHM cPanel Log Rotation Configuration Interface.
The steps should be performed only by experienced system administrators to prevent any accidental data loss, only qualified individuals should attempt the process.
The method described by the document herein is not guaranteed to work as it is of an experimental nature.
To do this one has to run the ‘du’ command, after ensuring one is logged in as the root user.
du -h /var/log/
The ‘du’ command gives an estimate of the size and space occupied by each log file and directory along the specified path. In the above example the /var/log/ path respectively.
The ‘-h’ component of the command is ensures that the data is presented in a format humanly intelligible or readable.
Having checked the Disk Space occupied by log files one can either compress or delete the same.
Reducing Size of Log Files:
Deleting Log Files:
One may also choose to Delete files that are taking up an unnecessary amount of disk space, such as old archived log files. One has to:
cat /dev/null > munin-update.log
This command ensures therefore the deletion of the file data, retaining the file name.
One can also choose to Enable the cPanel or WHM Log Rotation system which helps to compress and then store old log files in the /usr/local/cpanel/logs/archive/ directory, aiding the process of managing and reducing disk space occupied.
One can choose to follow any one of the various methods outlined above in order to reduce the size of or manage Log Files.