![Ubuntu 18.04 - 如果我删除 /var/log/syslog 会发生什么?](https://linux22.com/image/1172450/Ubuntu%2018.04%20-%20%E5%A6%82%E6%9E%9C%E6%88%91%E5%88%A0%E9%99%A4%20%2Fvar%2Flog%2Fsyslog%20%E4%BC%9A%E5%8F%91%E7%94%9F%E4%BB%80%E4%B9%88%EF%BC%9F.png)
这个问题分为两部分。首先,删除 syslog 或 syslog.x 文件(其中 x 是 syslog 文件链中的整数 >= 1)有什么害处吗?这些文件占用了我 90% 的磁盘空间。
详细信息:我在日志文件中收到此错误。
tail -f /var/log/syslog.1
:
May 5 00:06:22 Skynet org.gnome.Nautilus[2942]: [00007f92580911b0] vdpau_chroma filter error: video mixer attributes failure: An invalid handle value was provided.
May 5 00:06:22 Skynet org.gnome.Nautilus[2942]: [00007f92580911b0] vdpau_chroma filter error: video mixer attributes failure: An invalid handle value was provided.
May 5 00:06:22 Skynet org.gnome.Nautilus[2942]: [00007f92580911b0] vdpau_chroma filter error: video mixer rendering failure: An invalid handle value was provided.
May 5 00:06:22 Skynet org.gnome.Nautilus[2942]: [00007f92580911b0] vdpau_chroma filter error: video mixer features failure: An invalid handle value was provided.
May 5 00:06:22 Skynet org.gnome.Nautilus[2942]: [00007f92580911b0] vdpau_chroma filter error: video mixer attributes failure: An invalid handle value was provided.
May 5 00:06:22 Skynet org.gnome.Nautilus[2942]: [00007f92580911b0] vdpau_chroma filter error: video mixer rendering failure: An invalid handle value was provided.
我找到了一个类似的帖子,我不知道是什么导致了系统日志中千兆字节的错误,他们认为 VLC 导致了此错误。我也在使用 VLC,怀疑它是导致问题的原因。我该如何释放磁盘空间?
我正在考虑做类似的事情
cat /dev/null > /var/log/syslog.1
希望它能暂时解决这个问题。还有人有其他想法吗?
答案1
答案2
停止 syslog 守护进程,只需删除文件并重新启动守护进程。这将重新创建文件。命令行取决于您使用的 syslog 守护进程,在我的情况下,我会运行:systemctl stop rsyslogd; rm /var/log/syslog; systemctl start rsyslog