The server has been in use for a long time, XenServer produced a lot of logs, and even some people because the log occupied space,
Cause problems with the system: The XAPI crashes, or the system is stuck, and the restart is not valid.
So we have to look at the log from time to time to see if the logs occupy space.
Check the system disk usage first (xenserver default is 4G system space)
[Email protected] log]#
Df-hal
filesystem Size used avail& nbsp Use% mounted on
/dev/sda1 4.0g 4. 0g 0G 100% /
none 0 & nbsp;0 0 - /proc
none 0 0 0 - /sys
......
As you can see, the/dev/sda1 space is full, in the system with a lot of directories, maybe a directory all occupy a lot of space, then we can find out, clean down
List which directories are in the system first
CD/
Ls
bin Dev Home media opt root srv usr
Boot etc lib mnt proc Sbin sys var
Cli-rt EULA lost+found myiso read_me_first.html selinux tmp
You can see a lot of directories, where we can look at the size of each directory individually.
Du-hcs var
2G var
2G
Total
You can see that the Var directory takes up the system look Oh you are 2G, then we switch to this directory to see the root directory that takes up space
Cd/var
Ls
Cache db Games local log NIS patch run swap XAPI YP
Crash empty Lib lock mail opt preserve spool tmp Xen
The log directory is in this: log, check it
Du-hcs Log
1.9G Log
1.9G
Total
See the OG directory occupies the largest space, this is the log directory we can delete the following files
CD Log
Ls
Then we can delete all of the following files, you are afraid of operation errors, delete
RM-RF file name
After deletion, restart the System log service
Service Syslog Restart
If the above restarts or is not valid, you will need to restart the next XAPI
Service XAPI Restart
XenServer Log Cleanup method