In some situations, it can happen that the logrotate for a particular time does not occur or that during a period of time, a certain log grows in size due to some irregularity on the PAM application.
If the log files are not needed (like in most situations), disk space can be freed to prevent the disk from reaching 100%.
- Identify which log files are consuming most space:
du -sch /var/log/* | sort -h
Example:
root@pam01:/home/mt4adm# du -sch /var/log/* | sort -h | tail -n7
20M /var/log/senhasegura
35M /var/log/audit
145M /var/log/messages
285M /var/log/mysql
1.1G /var/log/journal
2.7G /var/log/daemon.log
4.3G total
- Empty the log files by echoing them:
In the example, the log file with higher disk space use is the daemon.log. Here is how to clean it:
echo "" > /var/log/daemon.log
Example:
root@pam01:/home/mt4adm# du -sch /var/log/* | sort -h | tail -n7
20M /var/log/senhasegura
35M /var/log/audit
145M /var/log/messages
285M /var/log/mysql
1.1G /var/log/journal
2.7G /var/log/daemon.log
4.3G total
root@pam01:/home/mt4adm# echo "" > /var/log/daemon.log
root@pam01:/home/mt4adm# du -sch /var/log/daemon.log
4.0K /var/log/daemon.log
4.0K total