I put my program in startup applications because of this. The directory /var/log
is taking around 36 GB space.
Can I delete syslog
and syslog.1
file which are taking the highest percentage of storage in /var/log
directory?
I put my program in startup applications because of this. The directory /var/log
is taking around 36 GB space.
Can I delete syslog
and syslog.1
file which are taking the highest percentage of storage in /var/log
directory?
Of course you can...
But... normally, on a default Ubuntu, the system will clean up logs automatically using something called logrotate. By default it will logrotate daily (You can see that in /etc/logrotate.d/rsyslog
)
Since they did become so large, you may want to see what is causing the log to become so incredibly large in less than 24h... There might be a significant problem, like a disk having a lot of errors. Perhaps take a look at the contents in real time for a while. To do that:
tail -f /var/log/syslog
To get back to your prompt, hit Ctrl-C
.
Furthermore, if they can't write to a log any more, they still should fail gracefully by... not logging. The next logrotate is usually going to fix it, for example mysql has the statement create 640 mysql adm
for its log files (see logrotate config)