在GCP VM/var/log中占用更多空间.如何减少呢? [英] In GCP VM /var/log taking more space. How to reduce it?
问题描述
我正在使用磁盘空间50GB的GCE.和/var/log单独占用12GB的空间.
I'm using GCE of disk space 50GB. and /var/log alone takes 12GB of space.
谁能告诉我下面的文件是什么?
can anyone tell me what are those below files?
alternatives.log auth.log.1 daemon.log debug.1 dpkg.log.2.gz kern.log.1 mail.err.1 mail.info.4.gz mail.warn messages.2.gz syslog.2.gz unattended-upgrades wtmp
alternatives.log.1 auth.log.2.gz daemon.log.1 debug.2.gz dpkg.log.3.gz kern.log.2.gz mail.err.2.gz mail.log mail.warn.1 messages.3.gz syslog.3.gz user.log wtmp.1
alternatives.log.2.gz auth.log.3.gz daemon.log.2.gz debug.3.gz exim4 kern.log.3.gz mail.info mail.log.1 mail.warn.2.gz messages.4.gz syslog.4.gz user.log.1
alternatives.log.3.gz auth.log.4.gz daemon.log.3.gz debug.4.gz faillog kern.log.4.gz mail.info.1 mail.log.2.gz mail.warn.3.gz ntpstats syslog.5.gz user.log.2.gz
apt btmp daemon.log.4.gz dpkg.log fontconfig.log lastlog mail.info.2.gz mail.log.3.gz messages syslog syslog.6.gz user.log.3.gz
auth.log btmp.1 debug dpkg.log.1 kern.log mail.err mail.info.3.gz mail.log.4.gz messages.1 syslog.1 syslog.7.gz user.log.4.gz
如果我将它们删除会怎样?
and what happen if I remove them?
还是只能删除.gz文件?
or can I remove only .gz file?
谢谢.
推荐答案
谁能告诉我下面的文件是什么?
can anyone tell me what are those below files?
否,因为它们取决于所安装的软件.但是其中一些非常重要,例如auth.log记录授权尝试,daemon.log记录守护程序活动,等等.它们用于调试,计费等.
No, because they depend of what software is installed. But some of them are very important, for example auth.log records authorization tries, daemon.log logs daemons activity, and so on. They serve for debugging, accounting and so on.
如果我将它们删除会怎样?
and what happen if I remove them?
可能没有什么危险,尤其是那些.1 .2或.old.gz等.但是 logrotate
将是尝试的正确解决方案.根据分发情况,它可能易于使用(只需安装软件包),或者可能需要完全手工制作的配置.
Probably nothing dangerous, especially those like .1 .2 or .old.gz and so on. But logrotate
would be the correct solution to try; depending on the distribution it can be easy to use (just install the package) or it may require quite hand-made configuration.
这篇关于在GCP VM/var/log中占用更多空间.如何减少呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!