仔细想想没有往服务器上传什么大的文件,也不能被黑(不起眼的小网站服务器)。于是,就逐一的检查”/”下的所有文件占用磁盘空间的大小。
[root@localhost ~]# du -s /*
6160 /bin
19380 /boot
156 /dev
21700 /etc
2383236 /home
112372 /lib
16 /lost+found
4 /media
4 /mnt
4 /opt
du: 无法访问"/proc/2187/task/2187/fd/4": 没有那个文件或目录
du: 无法访问"/proc/2187/task/2187/fdinfo/4": 没有那个文件或目录
du: 无法访问"/proc/2187/fd/4": 没有那个文件或目录
du: 无法访问"/proc/2187/fdinfo/4": 没有那个文件或目录
0 /proc
56 /root
9488 /sbin
4 /selinux
4 /srv
0 /sys
14760 /tmp
37310312 /usr
90452 /var
发现/usr占用了大约37.3G的磁盘空间,然后进入/usr检查。
[root@localhost ~]# du -s /usr/local/*
944 /usr/local/autoconf-2.13
472 /usr/local/bin
87568 /usr/local/eaccelerator_cache
4 /usr/local/etc
4 /usr/local/games
172 /usr/local/include
13824 /usr/local/ioncube
4100 /usr/local/lib
4 /usr/local/libexec
36 /usr/local/man
36436840 /usr/local/mysql
5108 /usr/local/nginx
53440 /usr/local/php
4 /usr/local/sbin
2620 /usr/local/share
4 /usr/local/src
900 /usr/local/zend
从返回的命令看出,占用最大的是/usr/local/mysql,继续检查。
[root@localhost ~]# du -s /usr/local/mysql/var/*
552 /usr/local/mysql/var/0t9
71196 /usr/local/mysql/var/feifeicms
1640 /usr/local/mysql/var/idc@002elianst@002ecom
320 /usr/local/mysql/var/localhost.localdomain.err
4 /usr/local/mysql/var/localhost.localdomain.pid
1032 /usr/local/mysql/var/mysql
28 /usr/local/mysql/var/mysql-bin.000001
1048 /usr/local/mysql/var/mysql-bin.000002
4 /usr/local/mysql/var/mysql-bin.000003
4 /usr/local/mysql/var/mysql-bin.000004
4 /usr/local/mysql/var/mysql-bin.000005
5092 /usr/local/mysql/var/mysql-bin.000006
3808 /usr/local/mysql/var/mysql-bin.000007
508 /usr/local/mysql/var/mysql-bin.000008
8 /usr/local/mysql/var/mysql-bin.000009
4 /usr/local/mysql/var/mysql-bin.000010
72 /usr/local/mysql/var/mysql-bin.000011
80 /usr/local/mysql/var/mysql-bin.000056
124 /usr/local/mysql/var/mysql-bin.000057
56 /usr/local/mysql/var/mysql-bin.000058
7556 /usr/local/mysql/var/mysql-bin.000059
6244 /usr/local/mysql/var/mysql-bin.000060
4 /usr/local/mysql/var/mysql-bin.000061
4 /usr/local/mysql/var/mysql-bin.000062
356 /usr/local/mysql/var/mysql-bin.000063
108 /usr/local/mysql/var/mysql-bin.000064
40 /usr/local/mysql/var/mysql-bin.000065
76 /usr/local/mysql/var/mysql-bin.000066
88 /usr/local/mysql/var/mysql-bin.000067
152 /usr/local/mysql/var/mysql-bin.000068
2648 /usr/local/mysql/var/mysql-bin.000069
84 /usr/local/mysql/var/mysql-bin.000070
108 /usr/local/mysql/var/mysql-bin.000071
52 /usr/local/mysql/var/mysql-bin.000072
104 /usr/local/mysql/var/mysql-bin.000073
172 /usr/local/mysql/var/mysql-bin.000074
408 /usr/local/mysql/var/mysql-bin.000075
848 /usr/local/mysql/var/mysql-bin.000076
72 /usr/local/mysql/var/mysql-bin.000077
36 /usr/local/mysql/var/mysql-bin.000078
56 /usr/local/mysql/var/mysql-bin.000079
80 /usr/local/mysql/var/mysql-bin.000080
236 /usr/local/mysql/var/mysql-bin.000081
104 /usr/local/mysql/var/mysql-bin.000082
324 /usr/local/mysql/var/mysql-bin.000083
3476 /usr/local/mysql/var/mysql-bin.000084
88 /usr/local/mysql/var/mysql-bin.000085
140 /usr/local/mysql/var/mysql-bin.000086
336 /usr/local/mysql/var/mysql-bin.000087
396 /usr/local/mysql/var/mysql-bin.000088
84 /usr/local/mysql/var/mysql-bin.000089
88 /usr/local/mysql/var/mysql-bin.000090
272 /usr/local/mysql/var/mysql-bin.000091
80 /usr/local/mysql/var/mysql-bin.000092
76 /usr/local/mysql/var/mysql-bin.000093
88 /usr/local/mysql/var/mysql-bin.000094
248 /usr/local/mysql/var/mysql-bin.000095
116 /usr/local/mysql/var/mysql-bin.000096
3028 /usr/local/mysql/var/mysql-bin.000097
64 /usr/local/mysql/var/mysql-bin.000098
220 /usr/local/mysql/var/mysql-bin.000099
64 /usr/local/mysql/var/mysql-bin.000100
76 /usr/local/mysql/var/mysql-bin.000101
80 /usr/local/mysql/var/mysql-bin.000102
208 /usr/local/mysql/var/mysql-bin.000103
64 /usr/local/mysql/var/mysql-bin.000104
64 /usr/local/mysql/var/mysql-bin.000105
64 /usr/local/mysql/var/mysql-bin.000106
240 /usr/local/mysql/var/mysql-bin.000107
64 /usr/local/mysql/var/mysql-bin.000108
68 /usr/local/mysql/var/mysql-bin.000109
68 /usr/local/mysql/var/mysql-bin.000110
184 /usr/local/mysql/var/mysql-bin.000111
64 /usr/local/mysql/var/mysql-bin.000112
68 /usr/local/mysql/var/mysql-bin.000113
64 /usr/local/mysql/var/mysql-bin.000114
180 /usr/local/mysql/var/mysql-bin.000115
56 /usr/local/mysql/var/mysql-bin.000116
56 /usr/local/mysql/var/mysql-bin.000117
52 /usr/local/mysql/var/mysql-bin.000118
72 /usr/local/mysql/var/mysql-bin.000119
2076 /usr/local/mysql/var/mysql-bin.000120
32 /usr/local/mysql/var/mysql-bin.000121
32 /usr/local/mysql/var/mysql-bin.000122
104 /usr/local/mysql/var/mysql-bin.000123
84 /usr/local/mysql/var/mysql-bin.000124
32 /usr/local/mysql/var/mysql-bin.000125
32 /usr/local/mysql/var/mysql-bin.000126
88 /usr/local/mysql/var/mysql-bin.000127
56 /usr/local/mysql/var/mysql-bin.000236
80 /usr/local/mysql/var/mysql-bin.000237
532 /usr/local/mysql/var/mysql-bin.000238
20 /usr/local/mysql/var/mysql-bin.000239
1048704 /usr/local/mysql/var/mysql-bin.000300
821624 /usr/local/mysql/var/mysql-bin.000301
981160 /usr/local/mysql/var/mysql-bin.000302
1048688 /usr/local/mysql/var/mysql-bin.000303
1049156 /usr/local/mysql/var/mysql-bin.000304
1048604 /usr/local/mysql/var/mysql-bin.000305
1025568 /usr/local/mysql/var/mysql-bin.000306
662604 /usr/local/mysql/var/mysql-bin.000307
705336 /usr/local/mysql/var/mysql-bin.000308
739816 /usr/local/mysql/var/mysql-bin.000309
788712 /usr/local/mysql/var/mysql-bin.000310
446864 /usr/local/mysql/var/mysql-bin.000311
1048880 /usr/local/mysql/var/mysql-bin.000312
1048708 /usr/local/mysql/var/mysql-bin.000313
602936 /usr/local/mysql/var/mysql-bin.000314
862772 /usr/local/mysql/var/mysql-bin.000315
894116 /usr/local/mysql/var/mysql-bin.000316
1048632 /usr/local/mysql/var/mysql-bin.000317
78332 /usr/local/mysql/var/mysql-bin.000318
1048656 /usr/local/mysql/var/mysql-bin.000319
307512 /usr/local/mysql/var/mysql-bin.000320
974816 /usr/local/mysql/var/mysql-bin.000321
1049144 /usr/local/mysql/var/mysql-bin.000322
1048636 /usr/local/mysql/var/mysql-bin.000323
1048688 /usr/local/mysql/var/mysql-bin.000324
122544 /usr/local/mysql/var/mysql-bin.000325
117868 /usr/local/mysql/var/mysql-bin.000326
733616 /usr/local/mysql/var/mysql-bin.000327
通过检查看到,好多mysql-bin.000XXX的文件,而且都还很大。经过询问度娘发现,此文件为mysql的日志文件,是可以删除的。因为这些日志文
件太大了,对我来说用处不大,索性就直接给关闭了。
[root@localhost ~]# vi /etc/my.cnf
在log-bin前面加上”#”
评论前必须登录!
注册