Linux系统装宝塔面板提示磁盘空间不足如何清理,检测到当前磁盘超过80%,空间不足如何清理
今天登陆服务器查看到磁盘空间满,如题这部分属于运维问题,如果直接点击
如何直接点立即清理会跳转企业版购买,1599CNY对普通用户来说是天价,因此 我们需要来手动清理。
单独购买磁盘清理也需要263CNY,当然了对于不愿意浪费时间得土豪此文略过。
大概做以下几步:
清理数据库日志
现在主流使用的mysql数据库我们以mysql为例,我们这台服务器的版本是5.7
按5.7的办法为:
登录mysql数据库
mysql -u root –p xxxxxxx
这里-u后面的 root 就是默认用户名 -p 后面需要接自己的数据库密码
mysql Ver 14.14 Distrib 5.7.40, for Linux (x86_64) using EditLine wrapper
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
。。。。
。。。
。。
提示这样是对的
purge master logs before '2023-11-20 00:00:00'; #删除'2023-11-22 00:00:00'之前的日志
这里自己定义自己的时间
清理Linux系统垃圾和临时文件
以centos为例 大家找到 /var/log
这里的都可以删除
清理所有站点的错误日志文件
大家继续找到 /www/wwwlogs
这里全是网站错误日志,不过请注意,这里的日志在访问没有错误的情况下清理,因为一旦有错误或者异常情况,通过日志查询原因是很重要的,当然了这些东西自然会占用空间了。
124.71.91.99 - - [19/Nov/2023:01:45:53 +0800] "GET / HTTP/1.1" 200 10669 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4280.67 Safari/537.36 Edg/97.0.664.52"
124.71.91.105 - - [19/Nov/2023:01:46:23 +0800] "GET /index.php?m=admin&c=index&a=login HTTP/1.1" 404 548 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.5359.95 Safari/537.36"
119.3.112.135 - - [19/Nov/2023:01:46:29 +0800] "GET /lm/category-%E8%A7%86%E9%A2%91APP%E6%BA%90%E7%A0%81.html HTTP/1.1" 200 5887 "https://m.baidu.com/from=1000539d/bd_page_type=1/ssid=0/uid=0/pu=usm%400%2Csz%401320_2001%2Cta%40iphone_1_16.6_25_16.6/baiduid=190AB00582069D00081367046C1A1A06/w=0_10_/t=iphone/l=1/tc?ref=www_iphone&lid=7468755674612366562&order=4&fm=alop&isAtom=1&waplogo=1&clk_info=%7B%22tplname%22%3A%22www_index%22%2C%22srcid%22%3A1599%2C%22jumpType%22%3A%22%22%7D&is_baidu=0&tj=www_index_4_0_10_title&vit=osres&cltj=normal_title&asres=1&phoneos=bd_search_iphone&wd=&eqid=67a659b70373fce2100000026558f86e&w_qd=IlPT2AEptyoA_ykx7uYo7RItrxNSbX9avly&bdver=2_1&tcplug=1&dict=-1&sec=34313&di=d08d6a0b696045d0&bdenc=1&nsrc=%2FOPkEndSS1OxJGcxb%2BQxSwq9yQV5S6MKddTHeLGCxiC44FWR1xf4dLbAIiR5UbYoGi9GpGXcIHOyHKWTNtzGgd19zoO3DPV5DFKqASX5P4ZuhV77uXu7OE3Kona1mcFsg%2F0GJ5ESYANYgr5fTV0pNnkWyy1MjST9DWAHjOENR6SN2Qz59Qunfao%2F3J4X4Oup" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
119.3.112.190 - - [19/Nov/2023:01:46:29 +0800] "GET /lm/zb_users/theme/hnysweb/style/index5.css HTTP/1.1" 200 17461 "https://www.youyacao.com/lm/category-%E8%A7%86%E9%A2%91APP%E6%BA%90%E7%A0%81.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
119.3.112.142 - - [19/Nov/2023:01:46:30 +0800] "GET /lm/zb_users/theme/hnysweb/style/js/hnysnet.js HTTP/1.1" 200 1644 "https://www.youyacao.com/lm/category-%E8%A7%86%E9%A2%91APP%E6%BA%90%E7%A0%81.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
119.3.112.99 - - [19/Nov/2023:01:46:30 +0800] "GET /lm/zb_system/script/zblogphp.js HTTP/1.1" 200 7204 "https://www.youyacao.com/lm/category-%E8%A7%86%E9%A2%91APP%E6%BA%90%E7%A0%81.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
119.3.112.203 - - [19/Nov/2023:01:46:30 +0800] "GET /lm/zb_system/script/c_html_js_add.php HTTP/1.1" 200 1826 "https://www.youyacao.com/lm/category-%E8%A7%86%E9%A2%91APP%E6%BA%90%E7%A0%81.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
119.3.112.179 - - [19/Nov/2023:01:46:30 +0800] "GET /lm/zb_system/script/jquery-2.2.4.min.js HTTP/1.1" 200 85582 "https://www.youyacao.com/lm/category-%E8%A7%86%E9%A2%91APP%E6%BA%90%E7%A0%81.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
119.3.112.94 - - [19/Nov/2023:01:46:30 +0800] "GET /lm/zb_users/theme/hnysweb/style/js/jquery.lazyload.js?v=1.9.1 HTTP/1.1" 200 9056 "https://www.youyacao.com/lm/category-%E8%A7%86%E9%A2%91APP%E6%BA%90%E7%A0%81.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
119.3.112.121 - - [19/Nov/2023:01:46:33 +0800] "GET /lm/zb_users/plugin/UEditor/third-party/prism/prism.css HTTP/1.1" 200 4153 "https://www.youyacao.com/lm/category-%E8%A7%86%E9%A2%91APP%E6%BA%90%E7%A0%81.html" "Mozilla/5.0 (iPhone; CPU iPhone OS 16_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1"
类似这样的一些内容,其实在被“搞事情”的情况下是很有用可以发现很多问题的。
最后大功告成,减少了很多,够用!