问题
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?
or can I remove only .gz file?
Thanks in advance.
回答1:
can anyone tell me what are those below files?
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?
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.
来源:https://stackoverflow.com/questions/60559965/in-gcp-vm-var-log-taking-more-space-how-to-reduce-it