How to clean system log in XENSERVER


After the XENSERVER server is used for half a year or a year, the XenServer generates a lot of log files. XenServer defaults to 4G system space, and these log files will occupy a lot of system space. If the log files are full, it will cause system problems: xapi crashes, or the system is stuck, and restarting is invalid. Therefore, regularly checking and cleaning the log files of the system is an important method to effectively ensure the normal operation of the system.

1. Check the partition space
df -hal

2. Check the size of each directory in the root directory
du -sh /* | sort -nr  

3. Check the var directory and the size of each directory
du -sh /var/* | sort -nr / /Here you can see that the log file log occupies the largest space

4. Check the log log file
cd log
ls

5. Delete the log log file
You can delete all the following files
rm -rf ./* (please make sure the current directory is located in /var/log / directory)
rm -rf file name (in case of uncertainty, you can delete one file at a time)

6.
After restarting xapi to delete, you need to restart xapi
service xapi restart

Note: the log space is not released after deletion,
restart the system log process
service syslog restart

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326689128&siteId=291194637