[+] 增加清理磁盘脚本
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 52s

This commit is contained in:
2025-02-06 09:37:50 +08:00
parent f7edc9d09e
commit c862c17133
2 changed files with 22 additions and 0 deletions

17
clean.sh Normal file
View File

@@ -0,0 +1,17 @@
# 清理 apt
sudo apt-get autoremove -y
sudo apt-get autoclean -y
sudo apt-get clean -y
# 清理 docker
docker system prune -a -f --volumes
# 清理日志
sudo journalctl --vacuum-size=10M
# 列出清理后容器大小
docker ps -a --format "{{.ID}}\t{{.Image}}\t{{.Size}}"
docker images --format "{{.Repository}}:{{.Tag}}\t{{.Size}}"
# 列出磁盘空间
df -h
# 查看占用磁盘
# sudo du -ah / | sort -rh | head -20