盒子存储过高

image

#!/bin/bash
echo "开始清理所有容器的日志文件"
logs=$(find /var/lib/docker/containers/ -name *-json.log)
for log in $logs
do
  echo "清理日志文件: $log"
  cat /dev/null > $log
done
echo "清理完成"

sudo truncate -s 0 /var/log/*.log

如果不行,试一下用上面的命令

image

image
image

把上面的信息,复制黏贴上来

企业微信截图_20230811112548

我们需要你直接把这些信息复制给我们,不是贴图

bin dev home lib64 media opt root sbin srv tmp usr var
boot etc lib lost+found mnt proc run selinux sys udns usrrun
root@smarthomefansbox:/# du -h --max-depth=1 | sort -hr
du: cannot access ‘./proc/1653/task/1653/fd/3’: No such file or directory
du: cannot access ‘./proc/1653/task/1653/fdinfo/3’: No such file or directory
du: cannot access ‘./proc/1653/fd/4’: No such file or directory
du: cannot access ‘./proc/1653/fdinfo/4’: No such file or directory
14G .
7.8G ./usr
5.1G ./var
94M ./root
79M ./boot
20M ./run
8.4M ./etc
4.0M ./udns
172K ./lib64
16K ./opt
16K ./lost+found
16K ./home
8.0K ./usrrun
4.0K ./srv
4.0K ./selinux
4.0K ./mnt
4.0K ./media
0 ./tmp
0 ./sys
0 ./proc
0 ./dev
root@smarthomefansbox:/# cd usr
root@smarthomefansbox:/usr# ls
bin games include lib libexec local sbin share src
root@smarthomefansbox:/usr# du -h --max-depth=1 | sort -hr
7.8G .
6.7G ./share
589M ./lib
369M ./bin
85M ./libexec
30M ./include
21M ./sbin
8.1M ./local
4.0K ./src
4.0K ./games
root@smarthomefansbox:/usr# cd share
root@smarthomefansbox:/usr/share# ls
aclocal consolefonts i18n python
aclocal-1.16 console-setup icons python3
adduser consoletrans info python-apt
alsa dbus-1 initramfs-tools python-wheels
apparmor-features debconf iptables readline
applications debianutils iso-codes resolvconf
apport dict keyrings screen
apt-file distro-info libc-bin selinux
aptitude doc lintian sensible-utils
armbian doc-base locale sounds
autoconf dpkg man sunxi-tools
automake-1.16 emacs man-db systemd
avahi f3 menu systemtap
base-files figlet misc tabset
base-passwd file nano tcltk
bash-completion fish openssh terminfo
binfmts gcc-8 pam unattended-upgrades
bison gdb pam-configs unicode
bug gettext perl vim
build-essential git-core perl5 X11
ca-certificates gitweb pixmaps xml
calendar glib-2.0 pkgconfig zoneinfo
chrony gnupg pkg-config-crosswrapper zsh
cmake groff pkg-config-dpkghook
command-not-found hal polkit-1
common-licenses hassio pyshared
root@smarthomefansbox:/usr/share# du -h --max-depth=1 | sort -hr
6.7G .
6.4G ./hassio
105M ./locale
78M ./doc
36M ./unicode
33M ./vim
21M ./perl
17M ./man
17M ./i18n
6.9M ./terminfo
5.3M ./aptitude
5.1M ./selinux
3.7M ./X11
3.4M ./zoneinfo
2.8M ./bash-completion
2.7M ./tcltk
2.1M ./consolefonts
1.9M ./python-wheels
1.8M ./groff
1.7M ./perl5
1.7M ./autoconf
1.6M ./alsa
1.5M ./xml
1.5M ./iso-codes
1.5M ./figlet
1.4M ./info
1.2M ./sounds
1.1M ./misc
1.1M ./automake-1.16
660K ./bison
564K ./ca-certificates
496K ./lintian
488K ./dict
460K ./calendar
324K ./screen
324K ./gitweb
296K ./gnupg
264K ./common-licenses
260K ./zsh
220K ./polkit-1
220K ./bug
208K ./dbus-1
188K ./python
184K ./python-apt
184K ./nano
180K ./keyrings
176K ./initramfs-tools
160K ./aclocal-1.16
148K ./python3
132K ./git-core
124K ./command-not-found
120K ./gcc-8
112K ./consoletrans
76K ./icons
68K ./doc-base
60K ./pixmaps
60K ./gdb
60K ./fish
60K ./dpkg
48K ./console-setup
44K ./pam
40K ./unattended-upgrades
36K ./base-files
32K ./menu
28K ./debconf
24K ./pkgconfig
24K ./apport
20K ./tabset
20K ./pyshared
20K ./hal
20K ./emacs
20K ./aclocal
16K ./systemd
16K ./pam-configs
16K ./gettext
16K ./cmake
16K ./applications
12K ./systemtap
12K ./sensible-utils
12K ./openssh
12K ./man-db
12K ./iptables
12K ./f3
12K ./distro-info
12K ./chrony
12K ./build-essential
12K ./binfmts
12K ./base-passwd
8.0K ./sunxi-tools
8.0K ./resolvconf
8.0K ./readline
8.0K ./libc-bin
8.0K ./glib-2.0
8.0K ./file
8.0K ./debianutils
8.0K ./avahi
8.0K ./apt-file
8.0K ./apparmor-features
8.0K ./adduser
4.0K ./armbian
root@smarthomefansbox:/usr/share# ls
aclocal consolefonts i18n python
aclocal-1.16 console-setup icons python3
adduser consoletrans info python-apt
alsa dbus-1 initramfs-tools python-wheels
apparmor-features debconf iptables readline
applications debianutils iso-codes resolvconf
apport dict keyrings screen
apt-file distro-info libc-bin selinux
aptitude doc lintian sensible-utils
armbian doc-base locale sounds
autoconf dpkg man sunxi-tools
automake-1.16 emacs man-db systemd
avahi f3 menu systemtap
base-files figlet misc tabset
base-passwd file nano tcltk
bash-completion fish openssh terminfo
binfmts gcc-8 pam unattended-upgrades
bison gdb pam-configs unicode
bug gettext perl vim
build-essential git-core perl5 X11
ca-certificates gitweb pixmaps xml
calendar glib-2.0 pkgconfig zoneinfo
chrony gnupg pkg-config-crosswrapper zsh
cmake groff pkg-config-dpkghook
command-not-found hal polkit-1
common-licenses hassio pyshared
root@smarthomefansbox:/usr/share# du -h --max-depth=1 | sort -hr
6.7G .
6.4G ./hassio
105M ./locale
78M ./doc
36M ./unicode
33M ./vim
21M ./perl
17M ./man
17M ./i18n
6.9M ./terminfo
5.3M ./aptitude
5.1M ./selinux
3.7M ./X11
3.4M ./zoneinfo
2.8M ./bash-completion
2.7M ./tcltk
2.1M ./consolefonts
1.9M ./python-wheels
1.8M ./groff
1.7M ./perl5
1.7M ./autoconf
1.6M ./alsa
1.5M ./xml
1.5M ./iso-codes
1.5M ./figlet
1.4M ./info
1.2M ./sounds
1.1M ./misc
1.1M ./automake-1.16
660K ./bison
564K ./ca-certificates
496K ./lintian
488K ./dict
460K ./calendar
324K ./screen
324K ./gitweb
296K ./gnupg
264K ./common-licenses
260K ./zsh
220K ./polkit-1
220K ./bug
208K ./dbus-1
188K ./python
184K ./python-apt
184K ./nano
180K ./keyrings
176K ./initramfs-tools
160K ./aclocal-1.16
148K ./python3
132K ./git-core
124K ./command-not-found
120K ./gcc-8
112K ./consoletrans
76K ./icons
68K ./doc-base
60K ./pixmaps
60K ./gdb
60K ./fish
60K ./dpkg
48K ./console-setup
44K ./pam
40K ./unattended-upgrades
36K ./base-files
32K ./menu
28K ./debconf
24K ./pkgconfig
24K ./apport
20K ./tabset
20K ./pyshared
20K ./hal
20K ./emacs
20K ./aclocal
16K ./systemd
16K ./pam-configs
16K ./gettext
16K ./cmake
16K ./applications
12K ./systemtap
12K ./sensible-utils
12K ./openssh
12K ./man-db
12K ./iptables
12K ./f3
12K ./distro-info
12K ./chrony
12K ./build-essential
12K ./binfmts
12K ./base-passwd
8.0K ./sunxi-tools
8.0K ./resolvconf
8.0K ./readline
8.0K ./libc-bin
8.0K ./glib-2.0
8.0K ./file
8.0K ./debianutils
8.0K ./avahi
8.0K ./apt-file
8.0K ./apparmor-features
8.0K ./adduser
4.0K ./armbian
root@smarthomefansbox:/usr/share# du -h --max-depth=1 | sort -hr
6.7G .
6.4G ./hassio
105M ./locale
78M ./doc
36M ./unicode
33M ./vim
21M ./perl
17M ./man
17M ./i18n
6.9M ./terminfo
5.3M ./aptitude
5.1M ./selinux
3.7M ./X11
3.4M ./zoneinfo
2.8M ./bash-completion
2.7M ./tcltk
2.1M ./consolefonts
1.9M ./python-wheels
1.8M ./groff
1.7M ./perl5
1.7M ./autoconf
1.6M ./alsa
1.5M ./xml
1.5M ./iso-codes
1.5M ./figlet
1.4M ./info
1.2M ./sounds
1.1M ./misc
1.1M ./automake-1.16
660K ./bison
564K ./ca-certificates
496K ./lintian
488K ./dict
460K ./calendar
324K ./screen
324K ./gitweb
296K ./gnupg
264K ./common-licenses
260K ./zsh
220K ./polkit-1
220K ./bug
208K ./dbus-1
188K ./python
184K ./python-apt
184K ./nano
180K ./keyrings
176K ./initramfs-tools
160K ./aclocal-1.16
148K ./python3
132K ./git-core
124K ./command-not-found
120K ./gcc-8
112K ./consoletrans
76K ./icons
68K ./doc-base
60K ./pixmaps
60K ./gdb
60K ./fish
60K ./dpkg
48K ./console-setup
44K ./pam
40K ./unattended-upgrades
36K ./base-files
32K ./menu
28K ./debconf
24K ./pkgconfig
24K ./apport
20K ./tabset
20K ./pyshared
20K ./hal
20K ./emacs
20K ./aclocal
16K ./systemd
16K ./pam-configs
16K ./gettext
16K ./cmake
16K ./applications
12K ./systemtap
12K ./sensible-utils
12K ./openssh
12K ./man-db
12K ./iptables
12K ./f3
12K ./distro-info
12K ./chrony
12K ./build-essential
12K ./binfmts
12K ./base-passwd
8.0K ./sunxi-tools
8.0K ./resolvconf
8.0K ./readline
8.0K ./libc-bin
8.0K ./glib-2.0
8.0K ./file
8.0K ./debianutils
8.0K ./avahi
8.0K ./apt-file
8.0K ./apparmor-features
8.0K ./adduser
4.0K ./armbian
root@smarthomefansbox:/usr/share# cd hassio
root@smarthomefansbox:/usr/share/hassio# ls
addons backup docker.json observer.json tmp0m2_3ni_
addons.json cli.json homeassistant services.json tmpaf0tt8w6
apparmor config.json homeassistant.json share updater.json
audio discovery.json ingress.json ssl
audio.json dns media store.json
auth.json dns.json multicast.json tmp
root@smarthomefansbox:/usr/share/hassio# du -h --max-depth=1 | sort -hr
6.4G .
6.1G ./homeassistant
254M ./backup
39M ./tmp
19M ./addons
64K ./apparmor
56K ./audio
12K ./dns
4.0K ./ssl
4.0K ./share
4.0K ./media
root@smarthomefansbox:/usr/share/hassio# cd homeassistant
root@smarthomefansbox:/usr/share/hassio/homeassistant# du -h --max-depth=1 | sor t -hr
6.1G .
158M ./node-red
25M ./custom_components
18M ./themes
5.5M ./.storage
2.6M ./www
100K ./zigbee2mqtt
60K ./image
32K ./blueprints
4.0K ./tts
4.0K ./.shaonianzhentan
4.0K ./packages
4.0K ./deps
4.0K ./.cloud
root@smarthomefansbox:/usr/share/hassio/homeassistant# ls
automations.yaml
blueprints
configuration.yaml
custom_components
deps
github_hosts_update.sh
groups.yaml
home-assistant.log
home-assistant.log.1
home-assistant.log.fault
home-assistant_v2.db
home-assistant_v2.db.corrupt.2023-01-22T20:12:00.484468+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:03.612660+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:06.683095+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:09.751527+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:12.832803+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:15.970086+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:19.032856+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:22.161418+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:25.437284+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:28.543717+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:31.675250+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:34.793172+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:37.871991+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:41.016783+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:44.089761+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:47.170693+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:50.245624+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:53.320496+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:56.416350+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:59.525449+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:02.679212+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:05.855566+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:08.964240+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:12.037777+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:15.108713+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:18.182596+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:21.262961+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:24.337059+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:27.427202+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:30.542847+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:33.648600+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:36.734937+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:39.897109+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:42.988345+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:46.106415+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:49.175363+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:53.694535+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:56.966934+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:00.041687+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:03.129638+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:06.264152+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:09.339640+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:12.425538+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:15.518629+00:00
home-assistant_v2.db.corrupt.2023-08-11T01:42:55.573080+00:00
home-assistant_v2.db.corrupt.2023-08-11T01:42:59.055678+00:00
home-assistant_v2.db-shm
home-assistant_v2.db-shm.corrupt.2023-01-22T20:12:00.484468+00:00
home-assistant_v2.db-shm.corrupt.2023-08-11T01:42:59.055678+00:00
home-assistant_v2.db-wal
home-assistant_v2.db-wal.corrupt.2023-01-22T20:12:00.484468+00:00
home-assistant_v2.db-wal.corrupt.2023-08-11T01:42:59.055678+00:00
image
molo_client_config_x.yaml
node-red
packages
replace_hacs_download_mirror.rar
replace_hacs_download_mirror.sh
scenes.yaml
scripts.yaml
secrets.yaml
themes
tts
www
zigbee2mqtt
root@smarthomefansbox:/usr/share/hassio/homeassistant# du -h --max-depth=1 | sort -hr
6.1G .
158M ./node-red
25M ./custom_components
18M ./themes
5.5M ./.storage
2.6M ./www
100K ./zigbee2mqtt
60K ./image
32K ./blueprints
4.0K ./tts
4.0K ./.shaonianzhentan
4.0K ./packages
4.0K ./deps
4.0K ./.cloud
root@smarthomefansbox:/usr/share/hassio/homeassistant# cd /
root@smarthomefansbox:/# ls
bin dev home lib64 media opt root sbin srv tmp usr var
boot etc lib lost+found mnt proc run selinux sys udns usrrun
root@smarthomefansbox:/# cd var
root@smarthomefansbox:/var# ls
backups cache lib local lock log log.hdd mail opt run spool tmp
root@smarthomefansbox:/var# cd lib
root@smarthomefansbox:/var/lib# ls
alsa avahi-autoipd containerd docker initramfs-tools misc polkit-1 resolvconf systemd vim
apt chrony dbus dpkg logrotate NetworkManager private selinux ucf
aptitude command-not-found dhcp git man-db pam python sudo usbutils
root@smarthomefansbox:/var/lib# cd docker
root@smarthomefansbox:/var/lib/docker# ls
buildkit containers image network overlay2 plugins runtimes swarm tmp tmp-old trust volumes
root@smarthomefansbox:/var/lib/docker# du -h --max-depth=1 | sort -hr
4.3G ./overlay2
4.3G .
21M ./image
580K ./containers
136K ./network
96K ./buildkit
44K ./volumes
16K ./plugins
4.0K ./trust
4.0K ./tmp-old
4.0K ./tmp
4.0K ./swarm
4.0K ./runtimes
root@smarthomefansbox:/var/lib/docker# cd/
-bash: cd/: No such file or directory
root@smarthomefansbox:/var/lib/docker# ls
buildkit containers image network overlay2 plugins runtimes swarm tmp tmp-old trust volumes
root@smarthomefansbox:/var/lib/docker# cd /
root@smarthomefansbox:/# ls
bin dev home lib64 media opt root sbin srv tmp usr var
boot etc lib lost+found mnt proc run selinux sys udns usrrun
root@smarthomefansbox:/# #!/bin/bash
root@smarthomefansbox:/# echo “开始清理所有容器的日志文件”
开始清理所有容器的日志文件
root@smarthomefansbox:/# logs=$(find /var/lib/docker/containers/ -name *-json.log)
root@smarthomefansbox:/# for log in $logs

do
echo “清理日志文件: $log”
cat /dev/null > $log
done
清理日志文件: /var/lib/docker/containers/e626ba2363053b12361a3d386a16d427f6fdd0627d87864f10a10fe263f1505c/e626ba2363053b12361a3d386a16d427f6fdd0627d87864f10a10fe263f1505c-json.log
清理日志文件: /var/lib/docker/containers/-json.log
root@smarthomefansbox:/# echo “清理完成”

给点时间我们,我们要做一下数据分析,看一下是哪些会存在大量的数据

电脑安装winscp,登陆进去找到/usr/share/hassio/homeasssitant里面,把这些都删除
home-assistant_v2.db
home-assistant_v2.db.corrupt.2023-01-22T20:12:00.484468+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:03.612660+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:06.683095+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:09.751527+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:12.832803+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:15.970086+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:19.032856+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:22.161418+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:25.437284+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:28.543717+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:31.675250+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:34.793172+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:37.871991+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:41.016783+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:44.089761+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:47.170693+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:50.245624+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:53.320496+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:56.416350+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:12:59.525449+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:02.679212+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:05.855566+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:08.964240+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:12.037777+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:15.108713+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:18.182596+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:21.262961+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:24.337059+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:27.427202+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:30.542847+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:33.648600+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:36.734937+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:39.897109+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:42.988345+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:46.106415+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:49.175363+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:53.694535+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:13:56.966934+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:00.041687+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:03.129638+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:06.264152+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:09.339640+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:12.425538+00:00
home-assistant_v2.db.corrupt.2023-01-22T20:14:15.518629+00:00
home-assistant_v2.db.corrupt.2023-08-11T01:42:55.573080+00:00
home-assistant_v2.db.corrupt.2023-08-11T01:42:59.055678+00:00
home-assistant_v2.db-shm
home-assistant_v2.db-shm.corrupt.2023-01-22T20:12:00.484468+00:00
home-assistant_v2.db-shm.corrupt.2023-08-11T01:42:59.055678+00:00
home-assistant_v2.db-wal
home-assistant_v2.db-wal.corrupt.2023-01-22T20:12:00.484468+00:00
home-assistant_v2.db-wal.corrupt.2023-08-11T01:42:59.055678+00:00
image