Logwatch太吵了

Logwatch is too noisy

我已经使用 Logwatch 至少 12 年了,但是自从我搬到 Ubuntu 18.04 以来,我对每天的电子邮件在文件系统中列出 37 /snap 感到非常恼火检查:

Filesystem      Size  Used Avail Use% Mounted on
 /dev/nvme0n1p2  439G  268G  149G  65% /
 /dev/loop0       83M   83M     0 100% /snap/shotcut/119
 /dev/loop1      234M  234M     0 100% /snap/gimp/322
 /dev/loop3      291M  291M     0 100% /snap/vlc/1620
 /dev/loop4      218M  218M     0 100% /snap/gnome-3-34-1804/60
 /dev/loop2      256K  256K     0 100% /snap/gtk2-common-themes/13
etc...

我之前一直在寻找解决方案,但没有成功,而且我一直在查看 logwatch 文件,但找不到任何设置来执行此操作。

我查看了 /usr/share/logwatch/scripts/services/zz-disk_space,其中 df 命令是:

df -h -x tmpfs -x devtmpfs -x udf -x iso9660

Filesystem                         Size  Used Avail Use% Mounted on
/dev/nvme0n1p2                     439G  268G  150G  65% /
/dev/loop0                          83M   83M     0 100% /snap/shotcut/119
/dev/loop1                         234M  234M     0 100% /snap/gimp/322
/dev/loop3                         291M  291M     0 100% /snap/vlc/1620
etc... (37 of those in total)

通过添加“-x squashfs”我得到了我想要的:

df -h -x tmpfs -x devtmpfs -x udf -x iso9660 -x squashfs

Filesystem                         Size  Used Avail Use% Mounted on
/dev/nvme0n1p2                     439G  268G  150G  65% /
/dev/sda                           3.6T  580G  2.9T  17% /backup
/dev/nvme0n1p1                     511M  7.4M  504M   2% /boot/efi
//192.168.0.200/nas-office/backup  1.9T  723G  1.2T  39% /mnt/nas

太棒了!