[+] 增加 traefik 清理
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 11s
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 11s
This commit is contained in:
parent
3a2e83f03a
commit
28188cf5c0
15
clean.sh
15
clean.sh
@ -1,3 +1,5 @@
|
|||||||
|
# 列出磁盘空间
|
||||||
|
df -h
|
||||||
# 清理 apt
|
# 清理 apt
|
||||||
sudo apt-get autoremove -y
|
sudo apt-get autoremove -y
|
||||||
sudo apt-get autoclean -y
|
sudo apt-get autoclean -y
|
||||||
@ -9,11 +11,9 @@ sudo journalctl --vacuum-size=10M
|
|||||||
# 列出清理后容器大小
|
# 列出清理后容器大小
|
||||||
docker ps -a --format "{{.ID}}\t{{.Image}}\t{{.Size}}"
|
docker ps -a --format "{{.ID}}\t{{.Image}}\t{{.Size}}"
|
||||||
docker images --format "{{.Repository}}:{{.Tag}}\t{{.Size}}"
|
docker images --format "{{.Repository}}:{{.Tag}}\t{{.Size}}"
|
||||||
# 列出磁盘空间
|
|
||||||
df -h
|
|
||||||
|
|
||||||
# 查看占用磁盘
|
# 查看占用磁盘
|
||||||
# sudo du -ah / | sort -rh | head -20
|
# du -ah -d 1 /
|
||||||
|
|
||||||
if [ -d "/root/act_runner" ] && docker images | grep -q "docker.martin98.com/library/gitea/act_runner"; then
|
if [ -d "/root/act_runner" ] && docker images | grep -q "docker.martin98.com/library/gitea/act_runner"; then
|
||||||
echo "清理 act_runner"
|
echo "清理 act_runner"
|
||||||
@ -33,3 +33,12 @@ if [ -d "/root/registry" ] && docker images | grep -q "registry"; then
|
|||||||
cd /root/registry
|
cd /root/registry
|
||||||
sh restart.sh
|
sh restart.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d "/root/registry" ] && docker ps --format '{{.ID}} {{.Image}}' | grep -q 'traefik'; then
|
||||||
|
echo "清理 Traefik"
|
||||||
|
container_id=$(docker ps --format '{{.ID}} {{.Image}}' | grep 'traefik' | awk '{print $1}')
|
||||||
|
docker exec -it $container_id sh -c "rm -rf /tmp/*"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 列出磁盘空间
|
||||||
|
df -h
|
||||||
|
Loading…
x
Reference in New Issue
Block a user