XenServer Log Cleanup method

Source: Internet
Author: User
Tags xapi

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.